diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-30 18:24:03 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-30 18:24:03 +0000 |
commit | 4f4d5f3610dc416ca91e216906a2879bfcdd5954 (patch) | |
tree | 898830c9b66436ffd54795f64963d3607f64c897 /gcc/testsuite/gcc.dg/anon-struct-15.c | |
parent | 0745d7a3aa57f039d261950fee822bd9bbefd1dd (diff) | |
download | gcc-4f4d5f3610dc416ca91e216906a2879bfcdd5954.tar.gz |
PR c/46889
* c-decl.c (detect_field_duplicates): Ensure hash is used for
finding duplicates when first field is anonymous.
testsuite:
* gcc.dg/anon-struct-15.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168348 138bc75d-0d04-0410-961f-82ee72b054a4
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 00000000000..d9e786a8d86 --- /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" } */ +}; |