diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/anon-struct-15.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/anon-struct-15.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/anon-struct-15.c b/gcc/testsuite/gcc.dg/anon-struct-15.c new file mode 100644 index 000000000..d9e786a8d --- /dev/null +++ b/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" } */ +}; |