mirror of git://gcc.gnu.org/git/gcc.git
re PR c/46889 (Missing diagnosis on duplicate struct member with anonymous union)
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. From-SVN: r168348
This commit is contained in:
parent
08b2ba302b
commit
b3c1008c10
|
@ -1,3 +1,9 @@
|
||||||
|
2010-12-30 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
PR c/46889
|
||||||
|
* c-decl.c (detect_field_duplicates): Ensure hash is used for
|
||||||
|
finding duplicates when first field is anonymous.
|
||||||
|
|
||||||
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
|
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
PR target/44606
|
PR target/44606
|
||||||
|
|
|
@ -6805,11 +6805,9 @@ detect_field_duplicates (tree fieldlist)
|
||||||
|
|
||||||
/* First, see if there are more than "a few" fields.
|
/* First, see if there are more than "a few" fields.
|
||||||
This is trivially true if there are zero or one fields. */
|
This is trivially true if there are zero or one fields. */
|
||||||
if (!fieldlist)
|
if (!fieldlist || !DECL_CHAIN (fieldlist))
|
||||||
return;
|
|
||||||
x = DECL_CHAIN (fieldlist);
|
|
||||||
if (!x)
|
|
||||||
return;
|
return;
|
||||||
|
x = fieldlist;
|
||||||
do {
|
do {
|
||||||
timeout--;
|
timeout--;
|
||||||
if (DECL_NAME (x) == NULL_TREE
|
if (DECL_NAME (x) == NULL_TREE
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-12-30 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
PR c/46889
|
||||||
|
* gcc.dg/anon-struct-15.c: New test.
|
||||||
|
|
||||||
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
|
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
PR target/44606
|
PR target/44606
|
||||||
|
|
|
@ -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" } */
|
||||||
|
};
|
Loading…
Reference in New Issue