The following invalid code snippet causes an ICE on mainline: =================================== template<operator T> void foo() { struct A {}; } =================================== bug.cc:1: error: expected identifier before 'operator' bug.cc:1: error: expected `>' before 'operator' bug.cc: In function 'void foo()': bug.cc:3: internal compiler error: tree check: accessed elt 1 of tree_vec with 0 elts in any_dependent_template_arguments_p, at cp/pt.c:12762 Please submit a full bug report, [etc.]
Confirmed.
A regression hunt on powerpc-linux identified the following patch: http://gcc.gnu.org/viewcvs?view=rev&rev=113081 r113081 | mmitchel | 2006-04-19 16:58:23 +0000 (Wed, 19 Apr 2006)
Subject: Bug 27493 Author: lmillward Date: Sat Sep 2 14:15:37 2006 New Revision: 116661 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116661 Log: 2006-09-02 Lee Millward <lee.millward@codesourcery.com> PR c++/27670 PR c++/27493 PR c++/27494 PR c++/27397 * parser.c (cp_parser_template_parameter_list): Add invalid template parameters to the parameter list as error_mark_node. * g++.dg/template/operator9.C: New test. * g++.dg/template/operator7.C: New test. * g++.dg/template/operator8.C: New test. * g++.dg/template/crash57.C: New test. * g++.dg/template/typedef4.C: Adjust error markers. * g++.dg/template/typedef5.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/template/crash57.C trunk/gcc/testsuite/g++.dg/template/operator7.C trunk/gcc/testsuite/g++.dg/template/operator8.C trunk/gcc/testsuite/g++.dg/template/operator9.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/typedef4.C trunk/gcc/testsuite/g++.dg/template/typedef5.C
Fixed in 4.2.