From: Richard Stallman Date: Wed, 15 Jul 1992 18:39:52 +0000 (+0000) Subject: (finish_struct): Handle nested struct redefinitions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d7bbe5f87bd33d7d4c03376767c8856ca266e50;p=gcc.git (finish_struct): Handle nested struct redefinitions. From-SVN: r1593 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index bbcec2ea5c4..5a730e81d58 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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));