diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2002-11-26 17:36:14 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-11-26 17:36:14 +0000 |
commit | 5326cd3d2294654972d8c53dd9f4806b5afb72da (patch) | |
tree | cf464f3ae55614a2e07ff3ab1da70a30d158dc41 /gcc/c-decl.c | |
parent | 0412a4d4d73111b92a5360f68ed78ae8e4501d24 (diff) | |
download | gcc-5326cd3d2294654972d8c53dd9f4806b5afb72da.zip gcc-5326cd3d2294654972d8c53dd9f4806b5afb72da.tar.gz gcc-5326cd3d2294654972d8c53dd9f4806b5afb72da.tar.bz2 |
* c-decl.c: (start_struct): Commonize flag setting.
From-SVN: r59527
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 5b078c0..ef4840a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4954,25 +4954,22 @@ start_struct (code, name) ref = lookup_tag (code, name, current_binding_level, 1); if (ref && TREE_CODE (ref) == code) { - C_TYPE_BEING_DEFINED (ref) = 1; - TYPE_PACKED (ref) = flag_pack_struct; if (TYPE_FIELDS (ref)) { if (code == UNION_TYPE) - error ("redefinition of `union %s'", - IDENTIFIER_POINTER (name)); + error ("redefinition of `union %s'", IDENTIFIER_POINTER (name)); else - error ("redefinition of `struct %s'", - IDENTIFIER_POINTER (name)); + error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name)); } - - return ref; } + else + { + /* Otherwise create a forward-reference just so the tag is in scope. */ - /* Otherwise create a forward-reference just so the tag is in scope. */ - - ref = make_node (code); - pushtag (name, ref); + ref = make_node (code); + pushtag (name, ref); + } + C_TYPE_BEING_DEFINED (ref) = 1; TYPE_PACKED (ref) = flag_pack_struct; return ref; |