-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang can't compile libstdc++ ranges #46091
Comments
Hm, I've just realized that gcc also can't compile the code if clang is used to preprocess it first. |
I think that's expected. Standard library headers contain preprocessor branches conditioned on things like __has_builtin(). Since gcc and clang don't support the exact same set of builtins, preprocessing with one can easily result in code that's not compilable with the other. |
Here's another example that fails with clang: ======= begin example ============= void foo() { clang complains that iota_view doesn't have a begin(), which it does. |
I think this is a libstdc++ bug. Details here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97120. |
Another example: #include std::map<int, int> map; int main() { |
I blieve this is due to this bug: llvm/llvm-bugzilla-archive#50864 |
mentioned in issue llvm/llvm-bugzilla-archive#50328 |
mentioned in issue llvm/llvm-bugzilla-archive#50864 |
Confirmed to work after https://reviews.llvm.org/D126907, so this was also a duplicate of #44178. Closing. |
@llvm/issue-subscribers-clang-frontend |
Extended Description
GCC 10.1.0 came with libstdc++ that has
<ranges>
implemented. Also clang 10 supports concepts. I wanted to use clang to compile a simple snippet that relies on ranges, but clang encountered some errors that just don't happen with gcc.The preprocessed file can be found here: https://godbolt.org/z/7hfbq5
I've also made an attachment with the same preprocessed file compressed.
The text was updated successfully, but these errors were encountered: