aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/offsetof7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/offsetof7.C')
-rw-r--r--gcc/testsuite/g++.dg/other/offsetof7.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/offsetof7.C b/gcc/testsuite/g++.dg/other/offsetof7.C
new file mode 100644
index 00000000000..0ce2ee02aa8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/offsetof7.C
@@ -0,0 +1,17 @@
+// PR c++/50608
+// Testcase by <dberger@oubliette.org>
+// { dg-do compile }
+
+struct A {
+ int offset;
+};
+
+struct B: public A {
+};
+
+struct C {
+ A a;
+ B b;
+};
+
+int fails = __builtin_offsetof (C, b.offset);