summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-12 09:54:38 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-12 09:54:38 +0000
commitd8be52c7abcac0437b460ca40e6e1f6083e934b9 (patch)
tree2b6f90fa1ae94ee69866e8a505fb8ad0cde87159 /gcc/c-decl.c
parent96995faf40e6daaab7eb2c1477a6964b53f13d17 (diff)
downloadgcc-d8be52c7abcac0437b460ca40e6e1f6083e934b9.tar.gz
PR c/9928
* c-decl.c (duplicate_decls): Discard the initializer of the new decl only if it is a VAR_DECL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64235 138bc75d-0d04-0410-961f-82ee72b054a4
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 f7996f1a812..2aa0ee77f67 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