The following invalid code snippet triggers an ICE since GCC 4.0.0: ================================================= struct A { template<int> void foo()(0); }; ================================================= bug.cc:3: internal compiler error: in grokfield, at cp/decl2.c:846 Please submit a full bug report, [etc.]
Confirmed.
Subject: Bug 29730 Author: mmitchel Date: Wed Dec 6 22:54:51 2006 New Revision: 119601 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119601 Log: PR c++/29730 * parser.c (cp_parser_init_declarator): Reject initialization of functions. PR c++/29730 * g++.dg/template/crash64.C: New test. * g++.dg/parse/crash27.C: Adjust error markers. Added: trunk/gcc/testsuite/g++.dg/template/crash64.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/parse/crash27.C
Fixed in 4.3.0.
Subject: Bug 29730 Author: mmitchel Date: Thu Dec 7 17:49:32 2006 New Revision: 119631 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119631 Log: PR c++/29730 * parser.c (cp_parser_init_declarator): Reject initialization of functions. PR c++/29730 * g++.dg/template/crash64.C: New test. * g++.dg/parse/crash27.C: Adjust error markers. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash64.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/parser.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/crash27.C
Subject: Bug 29730 Author: mmitchel Date: Thu Dec 7 18:08:42 2006 New Revision: 119632 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119632 Log: PR c++/29730 * parser.c (cp_parser_init_declarator): Reject initialization of functions. PR c++/29730 * g++.dg/template/crash64.C: New test. * g++.dg/parse/crash27.C: Adjust error markers. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/crash64.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/parser.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/g++.dg/parse/crash27.C
Fixed in 4.1.2, 4.2.0.
Fixed in GCC-4.1.2.
*** Bug 31026 has been marked as a duplicate of this bug. ***