summaryrefslogtreecommitdiff
path: root/test/SemaCXX/offsetof.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/SemaCXX/offsetof.cpp
parenta0482fa4e7fa27b01184f938097f0666b78016dd (diff)
Diffstat (limited to 'test/SemaCXX/offsetof.cpp')
-rw-r--r--test/SemaCXX/offsetof.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaCXX/offsetof.cpp b/test/SemaCXX/offsetof.cpp
index 639d7faa8e96f..17cee62d16fc8 100644
--- a/test/SemaCXX/offsetof.cpp
+++ b/test/SemaCXX/offsetof.cpp
@@ -53,3 +53,16 @@ struct Derived2 : public Base1, public Base2 {
int derived1[__builtin_offsetof(Derived2, x) == 0? 1 : -1];
int derived2[__builtin_offsetof(Derived2, y) == 4? 1 : -1];
int derived3[__builtin_offsetof(Derived2, z) == 8? 1 : -1];
+
+// offsetof referring to anonymous struct in base.
+// PR7769
+struct foo {
+ struct {
+ int x;
+ };
+};
+
+struct bar : public foo {
+};
+
+int anonstruct[__builtin_offsetof(bar, x) == 0 ? 1 : -1];