================
@@ -470,3 +470,20 @@ struct S2 {
const struct S2 s2[2] = {{{"foo"}, 1}, [0].L[2] = 'x'}; // expected-warning
{{initializer partially overrides prior initialization of this subobject}} \
// expected-note
{{previous initialization is here}}
static_assert(s2[0].L[2] == 'x');// expected-warning {{folding it to a
constant is a GNU extension}}
+
+// gh121694
+const int a = 0;
+struct C { const int *p; };
+constexpr struct C c1 = {&a}; // expected-error{{constexpr pointer initializer
is not null}}
----------------
Halalaluyafail3 wrote:
> > `woo` is a value of the type `nullptr_t`,
>
> I’m not particularly good at reading the C standard, but perhaps the question
> is: what does ‘value’ mean? Rvalue or lvalue? `woo` is definitely an _lvalue_
> of type `nullptr_t`, but I don’t know I’d call it a ‘value’.
Section 3.22 Paragraph 1 ISO/IEC 9899:2024:
> precise meaning of the contents of an object when interpreted as having a
> specific type
The C standard also never defines what an rvalue is.
https://github.com/llvm/llvm-project/pull/228776
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits