]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-decl.c (grokfield): Allow typedefs for anonymous structs and unions by default...
authorJoseph Myers <joseph@codesourcery.com>
Sat, 15 May 2010 19:07:01 +0000 (20:07 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sat, 15 May 2010 19:07:01 +0000 (20:07 +0100)
commit4bdd0a60b27aa25d23cc19e4ab23163edf1a363b
tree58437182e5b92c32014bc05c7c720abea38f88b9
parentd025732d199d5fda6718e4e52661ae027421a5b4
c-decl.c (grokfield): Allow typedefs for anonymous structs and unions by default if...

* 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.

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.

From-SVN: r159439
gcc/ChangeLog
gcc/c-decl.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20080820.c
gcc/testsuite/gcc.dg/anon-struct-1.c
gcc/testsuite/gcc.dg/c1x-anon-struct-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c1x-anon-struct-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c90-anon-struct-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c99-anon-struct-1.c [new file with mode: 0644]