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
This commit is contained in:
Jakub Jelinek 2002-02-20 23:59:35 +01:00 committed by Jakub Jelinek
parent 4636c87e23
commit 00fae85dcb
6 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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>

View File

@ -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)

View File

@ -1,3 +1,8 @@
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

View File

@ -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

View File

@ -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.

View File

@ -0,0 +1,12 @@
/* 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" } */
}