mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 07:38:56 +08:00
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:
parent
4636c87e23
commit
00fae85dcb
@ -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>
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
12
gcc/testsuite/gcc.dg/noncompile/20020220-1.c
Normal file
12
gcc/testsuite/gcc.dg/noncompile/20020220-1.c
Normal 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" } */
|
||||
}
|
Loading…
Reference in New Issue
Block a user