aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c
new file mode 100644
index 000000000..d9e786a8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c
@@ -0,0 +1,16 @@
+/* Test diagnostics for duplicate field names involving anonymous
+ struct or union as first field. PR 46889. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct foo {
+ union {
+ struct {
+ unsigned long time_stamp;
+ };
+ struct {
+ int *page;
+ };
+ };
+ int *page; /* { dg-error "duplicate member" } */
+};