-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Miscompile with C++23 constexpr-unknown constant evaluation #129844
Labels
c++23
clang:codegen
IR generation bugs: mangling, exceptions, etc.
constexpr
Anything related to constant evaluation
miscompilation
Milestone
Comments
@llvm/issue-subscribers-clang-codegen Author: Eli Friedman (efriedma-quic)
Testcase:
This is synthetic; I have no idea how likely it is for anyone to actually run into this. Filing as a followup to discussion on #128409. |
This is also accepted by gcc and clang 19, why should it be rejected? |
Updated description to be more clear. |
efriedma-quic
added a commit
to efriedma-quic/llvm-project
that referenced
this issue
Mar 5, 2025
…consistently. Perform the check for constexpr-unknown values in the same place we perform checks for other values which don't count as constant expressions. While I'm here, also fix a rejects-valid with a reference that doesn't have an initializer. This diagnostic was also covering up some of the bugs here. The existing behavior with -fexperimental-new-constant-interpreter seems to be correct, but the diagnostics are slightly different; it would be helpful if someone could check on that as a followup. Followup to llvm#128409. Fixes llvm#129844. Fixes llvm#129845.
efriedma-quic
added a commit
to efriedma-quic/llvm-project
that referenced
this issue
Mar 10, 2025
…consistently (llvm#129952) Perform the check for constexpr-unknown values in the same place we perform checks for other values which don't count as constant expressions. While I'm here, also fix a rejects-valid with a reference that doesn't have an initializer. This diagnostic was also covering up some of the bugs here. The existing behavior with -fexperimental-new-constant-interpreter seems to be correct, but the diagnostics are slightly different; it would be helpful if someone could check on that as a followup. Followup to llvm#128409. Fixes llvm#129844. Fixes llvm#129845.
swift-ci
pushed a commit
to swiftlang/llvm-project
that referenced
this issue
Mar 11, 2025
…consistently (llvm#129952) Perform the check for constexpr-unknown values in the same place we perform checks for other values which don't count as constant expressions. While I'm here, also fix a rejects-valid with a reference that doesn't have an initializer. This diagnostic was also covering up some of the bugs here. The existing behavior with -fexperimental-new-constant-interpreter seems to be correct, but the diagnostics are slightly different; it would be helpful if someone could check on that as a followup. Followup to llvm#128409. Fixes llvm#129844. Fixes llvm#129845.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c++23
clang:codegen
IR generation bugs: mangling, exceptions, etc.
constexpr
Anything related to constant evaluation
miscompilation
Testcase:
Generates the following, which is wrong because the references point to x itself, not the referenced lvalue.
This is synthetic; I have no idea how likely it is for anyone to actually run into this. Filing as a followup to discussion on #128409.
The text was updated successfully, but these errors were encountered: