The following invalid code snippet triggers an ICE on mainline and 4.2 branch: ================================== class A { int i; }; A::A() { A(); } ================================== bug.cc:6: error: definition of implicitly-declared 'A::A()' bug.cc:6: error: declaration of 'A::A()' throws different exceptions bug.cc:2: error: from previous declaration 'A::A() throw ()' bug.cc: In constructor 'A::A()': bug.cc:6: internal compiler error: in finish_function, at cp/decl.c:11162 Please submit a full bug report, [etc.]
Confirmed.
Mine for the new year: Index: decl.c =================================================================== --- decl.c (revision 120211) +++ decl.c (working copy) @@ -6216,7 +6219,10 @@ 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 error_mark_node; + } /* Since we've smashed OLD_DECL to its DECL_TEMPLATE_RESULT, we must do the same to DECL. */
*** Bug 30304 has been marked as a duplicate of this bug. ***
I am testing a slightly different patch which is closer to what the rest of the function does, in that return NULL_TREE instead of error_mark_node. This fixes the problem still and also removes the error "throws different exceptions" which seems like a good idea.
I am unsing the following version: arm-2006q1-6-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar I get the same error as said above. I am not sure whether to modify the Code [ there are many files; so painful solution :-( ] . Is there a way I can compile the above without touching the C-Files ? Which version of gcc should I use ? Can any one suggest me a solution. Thanks and Regards, Dayananda dayas2003@yahoo.com +91 98452 59517
Will not be fixed in 4.2.0; retargeting at 4.2.1.
testing the patch right now
Any news? ;)
*** Bug 33556 has been marked as a duplicate of this bug. ***
Change target milestone to 4.2.3, as 4.2.2 has been released.
Testing this patch again to make sure it still works.
Subject: Bug 30303 Author: pinskia Date: Sun Oct 14 18:15:35 2007 New Revision: 129298 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129298 Log: 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. Added: trunk/gcc/testsuite/g++.dg/other/ctor1.C trunk/gcc/testsuite/g++.dg/other/ctor2.C trunk/gcc/testsuite/g++.dg/other/dtor1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Fixed on the trunk.
I am not going to be able to get this done for 4.2.x so unassigning.
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
The ICE disappeared on the 4.2 branch. Probably due to 2008-02-12 Jason Merrill <jason@redhat.com> PR c++/33916 * Revert: 2006-10-17 Mark Mitchell <mark@codesourcery.com> PR c++/29039 * typeck2.c (build_functional_cast): Don't zero-initialize non-PODs; instead, call their constructors.