OSDN Git Service

* c-decl.c (grokfield): Allow typedefs for anonymous structs and
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 May 2010 19:07:01 +0000 (19:07 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:09:18 +0000 (14:09 +0900)
unions by default if those structs and unions have no tags.  Do
not condition anonymous struct and unions handling on flag_iso.
Allow anonymous structs and unions for C1X.
(finish_struct): Do not diagnose lack of named fields when
anonymous structs and unions present for C1X.  Accept flexible
array members in structure with anonymous structs or unions but no
directly named fields.
* doc/extend.texi (Unnamed Fields): Update.

testsuite:
* gcc.dg/c1x-anon-struct-1.c, gcc.dg/c1x-anon-struct-2.c,
gcc.dg/c90-anon-struct-1.c, gcc.dg/c99-anon-struct-1.c: New tests.
* gcc.dg/20080820.c, gcc.dg/anon-struct-1.c: Update expected
diagnostics and type sizes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159439 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog

index 61d0842..db8e005 100644 (file)
@@ -1,3 +1,15 @@
+2010-05-15  Joseph Myers  <joseph@codesourcery.com>
+
+       * c-decl.c (grokfield): Allow typedefs for anonymous structs and
+       unions by default if those structs and unions have no tags.  Do
+       not condition anonymous struct and unions handling on flag_iso.
+       Allow anonymous structs and unions for C1X.
+       (finish_struct): Do not diagnose lack of named fields when
+       anonymous structs and unions present for C1X.  Accept flexible
+       array members in structure with anonymous structs or unions but no
+       directly named fields.
+       * doc/extend.texi (Unnamed Fields): Update.
+
 2010-05-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gimple.h (compare_field_offset): Rename into...
index 1ce44f0..2ee5942 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-15  Joseph Myers  <joseph@codesourcery.com>
+
+       * gcc.dg/c1x-anon-struct-1.c, gcc.dg/c1x-anon-struct-2.c,
+       gcc.dg/c90-anon-struct-1.c, gcc.dg/c99-anon-struct-1.c: New tests.
+       * gcc.dg/20080820.c, gcc.dg/anon-struct-1.c: Update expected
+       diagnostics and type sizes.
+
 2010-05-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/lto9.adb: New test.