]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/cp/class.c
52th Cygnus<->FSF merge
[gcc.git] / gcc / cp / class.c
index 9731ac1cb84ec8a817b7f414442a440c1e271810..b0e0cf8ff9736379c4056e98b3fdc86cfdd47a9f 100644 (file)
@@ -3982,12 +3982,15 @@ finish_struct (t, list_of_fieldlists, warn_anon)
       last_x = tree_last (TYPE_FIELDS (t));
       while (x)
        {
-#if 0 /* What's wrong with using the decl the type already has? */
-         tree tag = build_decl (TYPE_DECL, TREE_PURPOSE (x), TREE_VALUE (x));
-         DECL_CONTEXT (tag) = t;
-#else
          tree tag = TYPE_NAME (TREE_VALUE (x));
-#endif
+
+         /* Check to see if it is already there.  This will be the case if
+            was do enum { red; } color; */
+         if (chain_member (tag, TYPE_FIELDS (t)))
+             {
+               x = TREE_CHAIN (x);
+               continue;
+             }
 
 #ifdef DWARF_DEBUGGING_INFO
          if (write_symbols == DWARF_DEBUG)
@@ -4077,6 +4080,7 @@ finish_struct (t, list_of_fieldlists, warn_anon)
      the base types we marked.  */
   finish_vtbls (TYPE_BINFO (t), 1, t);
   TYPE_BEING_DEFINED (t) = 0;
+  hack_incomplete_structures (t);
 
   if (flag_rtti && TYPE_VIRTUAL_P (t) && CLASSTYPE_VTABLE_NEEDS_WRITING (t))
     {
@@ -4128,8 +4132,6 @@ finish_struct (t, list_of_fieldlists, warn_anon)
   else
     error ("trying to finish struct, but kicked out due to previous parse errors.");
 
-  hack_incomplete_structures (t);
-
   resume_momentary (old);
 
   if (flag_cadillac)
This page took 0.073145 seconds and 5 git commands to generate.