Commit 00fae85d by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/5713 (Redeclaration causes ice in in make_decl_rtl, at varasm.c:835)


	PR c++/5713
	* c-decl.c (duplicate_decls): Return 0 if issued error about
	redeclaration.

	* decl.c (duplicate_decls): Return 0 if issued error about
	redeclaration.

	* gcc.dg/noncompile/20020220-1.c: New test.

From-SVN: r49915
parent 4636c87e
2002-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/5713
* c-decl.c (duplicate_decls): Return 0 if issued error about
redeclaration.
2002-02-20 Roger Sayle <roger@eyesopen.com>
Jakub Jelinek <jakub@redhat.com>
......
......@@ -1690,6 +1690,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
&& current_binding_level == global_binding_level)
? "`%s' previously defined here"
: "`%s' previously declared here"));
return 0;
}
else if (TREE_CODE (newdecl) == TYPE_DECL
&& (DECL_IN_SYSTEM_HEADER (olddecl)
......
2002-02-20 Jakub Jelinek <jakub@redhat.com>
* decl.c (duplicate_decls): Return 0 if issued error about
redeclaration.
2002-02-19 Jason Merrill <jason@redhat.com>
ABI change: Mangle `void (A::*)() const' as
......
......@@ -3344,6 +3344,7 @@ duplicate_decls (newdecl, olddecl)
&& namespace_bindings_p ())
? "`%#D' previously defined here"
: "`%#D' previously declared here", olddecl);
return 0;
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != NULL_TREE
......
......@@ -4,6 +4,8 @@
* gcc.dg/20020219-1.c: New test.
* gcc.dg/noncompile/20020220-1.c: New test.
2002-02-17 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20020216-1.c: New test.
......
/* PR c++/5713
Test that there are no ICEs after redeclaration error. */
int foo (const char*, const char*);
void bar (void)
{
const char *s = "bar";
int i; /* { dg-error "previously declared here" } */
int size = 2;
int i = foo (s, s + size); /* { dg-error "redeclaration of" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment