(finish_struct): Handle nested struct redefinitions.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jul 1992 18:39:52 +0000 (18:39 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jul 1992 18:39:52 +0000 (18:39 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1593 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-decl.c

index bbcec2e..5a730e8 100644 (file)
@@ -4664,6 +4664,11 @@ finish_struct (t, fieldlist)
       if (C_DECL_VARIABLE_SIZE (x))
        C_TYPE_VARIABLE_SIZE (t) = 1;
 
+      /* Detect invalid nested redefinition.  */
+      if (TREE_TYPE (x) == t)
+       error ("nested redefinition of `%s'",
+              IDENTIFIER_POINTER (TYPE_NAME (t)));
+
       /* Detect invalid bit-field size.  */
       if (DECL_INITIAL (x))
        STRIP_NOPS (DECL_INITIAL (x));