+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
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. */
+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.
--- /dev/null
+/* { 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" } */
--- /dev/null
+/* { 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" } */
--- /dev/null
+/* { 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;
+}