]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/9928 (ICE on duplicate enum declaration)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Wed, 12 Mar 2003 10:04:52 +0000 (11:04 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 12 Mar 2003 10:04:52 +0000 (10:04 +0000)
PR c/9928
* c-decl.c (duplicate_decls): Discard the initializer of the new decl
only if it is a VAR_DECL.

From-SVN: r64239

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog

index 031a1b34494abbaf62f681b42d9ef20cb361b6b9..4fecda4cae93fe9a73b5ed768d71aab5224b05fa 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR c/9928
+       * c-decl.c (duplicate_decls): Discard the initializer of the new decl
+       only if it is a VAR_DECL.
+
 2003-03-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/9888
index ea02f2665569ef5f5427538d3f96bef7ccc4a1b1..9e05251c10476e20f8303aa6412f9d4e8c6f040a 100644 (file)
@@ -1670,7 +1670,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
         to variables that were declared between olddecl and newdecl. This
         will make the initializer invalid for olddecl in case it gets
         assigned to olddecl below.  */
-      DECL_INITIAL (newdecl) = 0;
+      if (TREE_CODE (newdecl) == VAR_DECL)
+       DECL_INITIAL (newdecl) = 0;
     }
   else
     {
index 7d877607d4deba96e4fba27d77e8cf1ca25bc96a..9a21126ef5e8e5de2a0cd151791edc9c4883c6b4 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.dg/decl-3.c: New test.
+
 2003-03-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/i386-loop-2.c: New test.
@@ -11980,3 +11984,4 @@ Mon Mar 22 14:28:46 1993  Ian Lance Taylor  (ian@cygnus.com)
        correspond to c-torture 1.11.
 
        * New file.
+