================
@@ -966,3 +966,15 @@ namespace AddressComparison {
static_assert(&U2.a[0] != &U2.b[1]);
static_assert(&U2.a[0] == &U2.b[1]); // both-error {{failed}}
}
+
+#if __cplusplus >= 202002L
+namespace UnionMemberOnePastEnd {
+ constexpr bool b() {
+ union {
+ int p;
+ };
+ return &p == (&p + 1);
----------------
tbaederr wrote:
Not in this specific configuration I think, but we have plenty of tests for the
"cannot refer to element 2 of non-array object" diagnostic.
https://github.com/llvm/llvm-project/pull/154342
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits