diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-05-09 17:19:28 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-05-09 17:19:28 +0100 |
commit | 492fc0eec511c06f6f159b7d88bc7a8212ce5c23 (patch) | |
tree | 40f3750c5c0d3e75e4ae38fc558b95bd1d59a14b /gcc/doc | |
parent | 44f276c65fc93a5ced092eca774c772cb10acd66 (diff) | |
download | gcc-492fc0eec511c06f6f159b7d88bc7a8212ce5c23.zip gcc-492fc0eec511c06f6f159b7d88bc7a8212ce5c23.tar.gz gcc-492fc0eec511c06f6f159b7d88bc7a8212ce5c23.tar.bz2 |
re PR c/4784 (Anonymous structs issues)
PR c/4784
* c-decl.c (detect_field_duplicates_hash): New. Handle anonymous
structures and unions recursively.
(detect_field_duplicates): Move duplicate detection with a hash to
detect_field_duplicates_hash. Always use a hash if anonymous
structures or unions are present.
* doc/extend.texi (Unnamed Fields): Document that duplicate fields
give errors.
testsuite:
* gcc.dg/anon-struct-9.c: New test.
From-SVN: r159204
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index bf74863..7a495eb 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12760,8 +12760,7 @@ struct @{ @end smallexample It is ambiguous which @code{a} is being referred to with @samp{foo.a}. -Such constructs are not supported and must be avoided. In the future, -such constructs may be detected and treated as compilation errors. +The compiler gives errors for such constructs. @opindex fms-extensions Unless @option{-fms-extensions} is used, the unnamed field must be a |