OSDN Git Service

gcc/:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Oct 2010 03:50:39 +0000 (03:50 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Oct 2010 03:50:39 +0000 (03:50 +0000)
commit2fdec0270fde38e7e29a94911db5203972853d47
treec18cd90272c7a2cb06261eb2a6d5a845ebb150f2
parenta05c0499e041a44aa666813e767e4e04ef7ce2f5
gcc/:
* c-typeck.c (lookup_field): If -fplan9-extensions, permit
referring to a field using a typedef name.
(find_anonymous_field_with_type): New static function.
(convert_to_anonymous_field): New static function.
(convert_for_assignment): If -fplan9-extensions, permit converting
pointer to struct to pointer to anonymous field.
* c-decl.c (grokfield): If -fplan9-extensions, permit anonymous
fields.
(is_duplicate_field): New static function.
(detect_field_duplicates_hash): If -fplan9-extensions, check for
typedef names duplicating field names.
(detect_field_duplicates): Likewise.
* doc/invoke.texi (Option Summary): Mention -fplan9-extensions.
(C Dialect Options): Document -fplan9-extensions.
* doc/extend.texi (Unnamed Fields): Document -fplan9-extensions.
gcc/c-family/:
* c.opt (-fplan9-extensions): New option.
gcc/testsuite/:
* gcc.dg/anon-struct-11.c: New test.
* gcc.dg/anon-struct-12.c: New test.
* gcc.dg/anon-struct-13.c: New test.
* gcc.dg/anon-struct-14.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164926 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/c-typeck.c
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/anon-struct-11.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/anon-struct-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/anon-struct-13.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/anon-struct-14.c [new file with mode: 0644]