[clang] [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #129952)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 5 21:25:22 PST 2025


================
@@ -154,3 +154,26 @@ int g() {
     static_assert(f(arr) == 5);
 }
 }
+
+namespace GH128409 {
+  int &ff();
+  int &x = ff(); // nointerpreter-note {{declared here}}
+  constinit int &z = x; // expected-error {{variable does not have a constant initializer}}
----------------
tbaederr wrote:

If you end the comments in `\`, you don't need to add the `@-2` stuff.

https://github.com/llvm/llvm-project/pull/129952


More information about the cfe-commits mailing list