-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
call to consteval in immediate invocation context fails #51182
Labels
bugzilla
Issues migrated from bugzilla
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
consteval
C++20 consteval
Comments
Thank you for the issue! I proposed a fix here - https://reviews.llvm.org/D119651 |
EugeneZelenko
added
the
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
label
Feb 12, 2022
@llvm/issue-subscribers-clang-frontend |
Alternative proposal: https://reviews.llvm.org/D132659 |
Repository owner
moved this from In Progress
to Done
in Core C++20 in Clang
Aug 26, 2022
Repository owner
moved this from In Progress
to Done
in C++ 20 in Clang
Aug 26, 2022
BertalanD
added a commit
to BertalanD/serenity
that referenced
this issue
May 21, 2024
Format string checking was disabled in Clang-based builds due to a compiler bug: llvm/llvm-project#51182. Now that the requirement has been raised to Clang 17, that is no longer necessary. This has been tested to work correctly with Apple Clang 15.0.0 (which is the *least modern* supported compiler), as well as CLion 2024.1's bundled Clangd.
BertalanD
added a commit
to BertalanD/serenity
that referenced
this issue
May 29, 2024
Format string checking was disabled in Clang-based builds due to a compiler bug: llvm/llvm-project#51182. Now that the requirement has been raised to Clang 17, that is no longer necessary. This has been tested to work correctly with Apple Clang 15.0.0 (which is the *least modern* supported compiler), as well as CLion 2024.1's bundled Clangd.
ADKaster
pushed a commit
to SerenityOS/serenity
that referenced
this issue
May 29, 2024
Format string checking was disabled in Clang-based builds due to a compiler bug: llvm/llvm-project#51182. Now that the requirement has been raised to Clang 17, that is no longer necessary. This has been tested to work correctly with Apple Clang 15.0.0 (which is the *least modern* supported compiler), as well as CLion 2024.1's bundled Clangd.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bugzilla
Issues migrated from bugzilla
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
consteval
C++20 consteval
Extended Description
Reduced from https://stackoverflow.com/questions/69166564
The following code fails on clang >= 11.0 (including trunk)
consteval int f(int) { return 1; }
template
consteval bool g(T a)
{
int n = f(a); // error here
return true;
}
static_assert(g(2));
with
error: call to consteval function 'f' is not a constant expression
note: read of non-const variable 'a' is not allowed in a constant expression
This seems incorrect. The evaluation of
f
is in an immediate context, i.e. insideg
sof(a)
should be a constant expression. Also, the error only appears ifg
is a template, and if the result off(a)
is stored in a local variable. GCC accepts the code.The text was updated successfully, but these errors were encountered: