-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 13 C++20 consteval error #2455
Comments
clang 13 hasn't been released yet. Do you mean the current development version of clang? Also do you have a godbolt repro? |
I'm using the Debian apt nightly packages from llvm: https://apt.llvm.org/. I've also tried with 12 and get the same error. I haven't been able to get a reproduction in godbolt yet. |
Just downgraded and confirmed I'm seeing the same thing with clang 12:
|
Please check code with |
Upgrading libc++ did in-fact fix the issue, great catch there. Thanks for your help. |
I also ran into this, and solved by downgrading my |
i'm seeing a slightly related error: appleclang (from xcode 12.5 and xcode 13) both ICE when compiling in c++20 mode. the ICE goes away when disabling the the code enables the consteval codepath when clang v11.1 is detected, though |
@timblechmann |
Your issue sounds more like #2438. |
@mwinterb I just realized the error was followed by a compiler crash.
|
@kotori2, please open a new issue since it's unrelated to the current one. |
@kotori2's issue reduces to:
|
|
I'm also seeing this on linux, and now want to use some C++20 features. Is it worth adding a configuration check for (presumably) partially missing standard library support for this? |
@ndevenish, there have been several unrelated issue reported here. What error do you get? |
Roughly equivalent to the original issue:
Hmm, did some further digging, and maybe I jumped a bit too soon on the suggestion of feature checks. Although it works fine in compiler C++17 mode, and the clang-based compiler (dpcpp) i'm using is supposed to have up-to-date (if not full) C++20 support, it looks like the setup I am given has GCC 7.4's libstdc++ underneath, which would probably imply very little C++20 existing on the library side. I suppose fixing this in features would require supporting C++20 the language changes without any C++20 The Standard Library changes, which probably isn't a reasonable. |
I think it's just a matter of refining the check here: Lines 461 to 462 in d141cdb
to account for unimplemented |
@vitaut, Why is this if statement needed?
|
It seems to specifically be using Lines 352 to 358 in d141cdb
|
To get sensible code in debug mode: https://godbolt.org/z/56W3YG5xe. |
It just doesn't play well with the fallback which is why it needs to be refined. |
Also added commentary for why std::strlen is directly called in certain situations. Addresses fmtlib#2455 (comment).
@ndevenish do you have a godbolt repro for the issue? |
This should be fixed now. |
haven't been able to test, yet, but apparently fixed it in xcode13.3 |
Seems like the version of clang Github actions (it is using 13.x) doesn't fully support the C++20 features being used by googletest. From fmtlib/fmt#2455, the only fix was to downgrade to C++17, but we don't want to do that
I'm getting a compilation error with
8.0.1
using clang 13:Here is the full invocation:
And my full clang version if it helps:
The text was updated successfully, but these errors were encountered: