The following invalid testcase triggers an ICE on mainline: ================================================ struct A { friend A A() {} }; ================================================ bug.cc:3: error: return type specification for constructor invalid bug.cc: In static member function 'static A::A()': bug.cc:3: internal compiler error: Segmentation fault Please submit a full bug report, [etc.]
I guess this is caused by r123312.
And related to PR22293. Testing a fix.
Subject: Bug 34488 Author: jakub Date: Tue Dec 18 00:15:32 2007 New Revision: 131025 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131025 Log: PR c++/34488 * decl.c (grokdeclarator): Reject friend sfk_constructor FUNCTION_TYPE. * g++.dg/parse/friend7.C: New test. Added: trunk/gcc/testsuite/g++.dg/parse/friend7.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Fixed.