aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-03-12 10:54:38 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-03-12 09:54:38 +0000
commit8a7d6cb3d82be44da036f45e244d01cd4f9ab0e5 (patch)
tree2b6f90fa1ae94ee69866e8a505fb8ad0cde87159 /gcc/c-decl.c
parentdb1077d3073cd525c15c5b957258685bfa224c18 (diff)
downloadgcc-8a7d6cb3d82be44da036f45e244d01cd4f9ab0e5.zip
gcc-8a7d6cb3d82be44da036f45e244d01cd4f9ab0e5.tar.gz
gcc-8a7d6cb3d82be44da036f45e244d01cd4f9ab0e5.tar.bz2
re PR c/9928 (ICE on duplicate enum declaration)
PR c/9928 * c-decl.c (duplicate_decls): Discard the initializer of the new decl only if it is a VAR_DECL. From-SVN: r64235
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f7996f1..2aa0ee7 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1146,7 +1146,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;
}
/* TLS cannot follow non-TLS declaration. */
else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL