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
+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
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
+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.
--- /dev/null
+/* PR c/9928 */
+/* { dg-do compile } */
+
+enum { CODES }; /* { dg-error "previous declaration" } */
+enum { CODES }; /* { dg-error "conflicting types" } */