summaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/cxx03.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/cxx03.cpp')
-rw-r--r--clang/test/AST/ByteCode/cxx03.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx03.cpp b/clang/test/AST/ByteCode/cxx03.cpp
index 70ae4134842b..10e5232b9f87 100644
--- a/clang/test/AST/ByteCode/cxx03.cpp
+++ b/clang/test/AST/ByteCode/cxx03.cpp
@@ -29,3 +29,14 @@ void LambdaAccessingADummy() {
int d;
int a9[1] = {[d = 0] = 1}; // both-error {{is not an integral constant expression}}
}
+
+const int p = 10;
+struct B {
+ int a;
+ void *p;
+};
+struct B2 : B {
+ void *q;
+};
+_Static_assert(&(B2().a) == &p, ""); // both-error {{taking the address of a temporary object of type 'int'}} \
+ // both-error {{not an integral constant expression}}