mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 10:50:51 +08:00
re PR c++/30303 (ICE with invalid constructor definition)
2007-10-14 Andrew Pinski <pinskia@gmail.com> PR c++/30303 * decl.c (grokfndecl): Return NULL after the "definition of implicitly-declared" error happened. 2007-10-14 Andrew Pinski <pinskia@gmail.com> PR c++/30303 * g++.dg/other/ctor1.C: New test. * g++.dg/other/ctor2.C: New test. * g++.dg/other/dtor1.C: New test. From-SVN: r129298
This commit is contained in:
parent
b7cc2adf34
commit
db160137f0
@ -1,3 +1,9 @@
|
||||
2007-10-14 Andrew Pinski <pinskia@gmail.com>
|
||||
|
||||
PR c++/30303
|
||||
* decl.c (grokfndecl): Return NULL after the "definition of
|
||||
implicitly-declared" error happened.
|
||||
|
||||
2007-10-12 Simon Martin <simartin@users.sourceforge.net>
|
||||
|
||||
PR c++/26698
|
||||
|
@ -6577,7 +6577,10 @@ grokfndecl (tree ctype,
|
||||
XXX Isn't this done in start_function, too? */
|
||||
revert_static_member_fn (decl);
|
||||
if (DECL_ARTIFICIAL (old_decl))
|
||||
error ("definition of implicitly-declared %qD", old_decl);
|
||||
{
|
||||
error ("definition of implicitly-declared %qD", old_decl);
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Since we've smashed OLD_DECL to its
|
||||
DECL_TEMPLATE_RESULT, we must do the same to DECL. */
|
||||
|
@ -1,3 +1,10 @@
|
||||
2007-10-14 Andrew Pinski <pinskia@gmail.com>
|
||||
|
||||
PR c++/30303
|
||||
* g++.dg/other/ctor1.C: New test.
|
||||
* g++.dg/other/ctor2.C: New test.
|
||||
* g++.dg/other/dtor1.C: New test.
|
||||
|
||||
2007-10-14 Tobias Burnus <burnus@gcc.gnu.org>
|
||||
|
||||
* gfortran.dg/bounds_check_10.f90: Fix testcase.
|
||||
|
11
gcc/testsuite/g++.dg/other/ctor1.C
Normal file
11
gcc/testsuite/g++.dg/other/ctor1.C
Normal file
@ -0,0 +1,11 @@
|
||||
/* { dg-do compile } */
|
||||
// PR C++/30303
|
||||
// This used to ICE because we did not return NULL
|
||||
// in grokfndecl when an error happened.
|
||||
|
||||
class A
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
A::A() { A(); } /* { dg-error "definition of implicitly-declared" } */
|
17
gcc/testsuite/g++.dg/other/ctor2.C
Normal file
17
gcc/testsuite/g++.dg/other/ctor2.C
Normal file
@ -0,0 +1,17 @@
|
||||
/* { dg-do compile } */
|
||||
// PR C++/30303
|
||||
// This used to ICE because we did not return NULL
|
||||
// in grokfndecl when an error happened.
|
||||
|
||||
|
||||
class A
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
void foo()
|
||||
{
|
||||
A();
|
||||
}
|
||||
|
||||
A::A() {} /* { dg-error "definition of implicitly-declared" } */
|
17
gcc/testsuite/g++.dg/other/dtor1.C
Normal file
17
gcc/testsuite/g++.dg/other/dtor1.C
Normal file
@ -0,0 +1,17 @@
|
||||
/* { dg-do compile } */
|
||||
// PR C++/30303
|
||||
// This used to ICE because we did not return NULL
|
||||
// in grokfndecl when an error happened.
|
||||
|
||||
struct Ifoo
|
||||
{
|
||||
virtual ~Ifoo(){}
|
||||
};
|
||||
struct foo : Ifoo
|
||||
{
|
||||
foo(){};
|
||||
};
|
||||
foo::~foo() // { dg-error "definition of implicitly-declared" }
|
||||
{
|
||||
delete this;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user