================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -std=c23 -verify -pedantic %s
+
+const int a = 0;
+struct C { const int *p; };
+constexpr struct C c1 = {&a}; // expected-error{{constexpr pointer initializer 
is not null}}
+constexpr struct C c2 = (struct C){&a}; // expected-error{{constexpr variable 
'c2' must be initialized by a constant expression}}
----------------
Fznamznon wrote:

Hmm, should that say something about pointer being non-null?

https://github.com/llvm/llvm-project/pull/228776
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to