]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-typeck.c (lookup_field): If -fplan9-extensions, permit referring to a field using...
authorIan Lance Taylor <iant@google.com>
Mon, 4 Oct 2010 03:50:39 +0000 (03:50 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 4 Oct 2010 03:50:39 +0000 (03:50 +0000)
commit478a1c5b906a165853b77a8dd1c0548b66ace018
treec18cd90272c7a2cb06261eb2a6d5a845ebb150f2
parent3b5269a95e9e50001c2e4fabbb1712c9e984a09d
c-typeck.c (lookup_field): If -fplan9-extensions, permit referring to a field using a typedef name.

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.

From-SVN: r164926
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]