summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 17:36:14 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 17:36:14 +0000
commit67be5043854e990ba73917c601965874eaa9fe09 (patch)
treecf464f3ae55614a2e07ff3ab1da70a30d158dc41 /gcc/c-decl.c
parent8d3ed03e78509b7d0ec31df6c72707ab7a7431d6 (diff)
downloadgcc-67be5043854e990ba73917c601965874eaa9fe09.tar.gz
* c-decl.c: (start_struct): Commonize flag setting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59527 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5b078c0cde5..ef4840ac8ff 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;