[all-commits] [llvm/llvm-project] 9010db: [Clang] Treat constexpr-unknown value as invalid i...

David Spickett via All-commits all-commits at lists.llvm.org
Tue Mar 11 14:02:34 PDT 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 9010db1b84ef81d23266b5c57569beadd7967ddb
      https://github.com/llvm/llvm-project/commit/9010db1b84ef81d23266b5c57569beadd7967ddb
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CGExprConstant.cpp
    A clang/test/CodeGenCXX/cxx23-p2280r4.cpp

  Log Message:
  -----------
  [Clang] Treat constexpr-unknown value as invalid in `EvaluateAsInitializer` (#128409)

It is an alternative to
https://github.com/llvm/llvm-project/pull/127525.
Close https://github.com/llvm/llvm-project/issues/127475.


  Commit: fbb2a7e74d918752aed9442ac8883ace8b636c50
      https://github.com/llvm/llvm-project/commit/fbb2a7e74d918752aed9442ac8883ace8b636c50
  Author: Eli Friedman <efriedma at quicinc.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/CodeGenCXX/cxx23-p2280r4.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression-p2280r4.cpp

  Log Message:
  -----------
  [clang] Reject constexpr-unknown values as constant expressions more consistently (#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 #128409.

Fixes #129844. Fixes #129845.


  Commit: 72c4a3f419f4ec5397a32859a20b112e225df4ea
      https://github.com/llvm/llvm-project/commit/72c4a3f419f4ec5397a32859a20b112e225df4ea
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M clang/test/CodeGenCXX/cxx23-p2280r4.cpp

  Log Message:
  -----------
  [clang][test] Don't require specific alignment in test case (#130589)

https://github.com/llvm/llvm-project/pull/129952 /
42d49a77241df73a17cb442973702fc460e7fb90 added this test which is
failing on 32-bit ARM because the alignment chosen is 4 not 8. Which
would make sense if this is a 32/64 bit difference

https://lab.llvm.org/buildbot/#/builders/154/builds/13059
```
<stdin>:34:30: note: scanning from here
define dso_local void @_Z1fv(ptr dead_on_unwind noalias writable sret(%struct.B) align 4 %agg.result) #0 {
                             ^
<stdin>:38:2: note: possible intended match here
 %0 = load ptr, ptr @x, align 4
 ^
```
The other test does not check alignment, so I'm assuming that it is not
important here.


Compare: https://github.com/llvm/llvm-project/compare/32ce5b043c2b...72c4a3f419f4

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list