OSDN Git Service

* c-decl.c: (start_struct): Commonize flag setting.
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Nov 2002 17:36:14 +0000 (17:36 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Nov 2002 17:36:14 +0000 (17:36 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59527 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-decl.c

index 6865d58..c44e14c 100644 (file)
@@ -1,3 +1,7 @@
+2002-11-26  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * c-decl.c: (start_struct): Commonize flag setting.
+
 2002-11-26  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
index 5b078c0..ef4840a 100644 (file)
@@ -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;