aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/unions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/unions.cpp')
-rw-r--r--clang/test/AST/ByteCode/unions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/unions.cpp b/clang/test/AST/ByteCode/unions.cpp
index 6bccbda..4140704 100644
--- a/clang/test/AST/ByteCode/unions.cpp
+++ b/clang/test/AST/ByteCode/unions.cpp
@@ -977,4 +977,13 @@ namespace UnionMemberOnePastEnd {
}
static_assert(!b());
}
+
+namespace ActicvateInvalidPtr {
+ constexpr void bar() { // both-error {{never produces a constant expression}}
+ union {
+ int a[1];
+ } foo;
+ foo.a[1] = 0; // both-note {{assignment to dereferenced one-past-the-end pointer}}
+ }
+}
#endif