The following invalid testcase triggers an ICE on mainline: ========================================= template<void> struct A { template<typename> friend struct B; }; template<typename> struct B {}; B<int> b; ========================================= bug.cc:1: error: 'void' is not a valid type for a template constant parameter bug.cc:3: internal compiler error: tree check: expected var_decl or function_decl or type_decl or template_decl, have error_mark in most_general_template, at cp/pt.c:11253 Please submit a full bug report, [etc.] This is probably fallout from PR 27668.
Confirmed. I'll take a look at it.
Subject: Bug 28736 Author: lmillward Date: Sat Aug 26 17:41:18 2006 New Revision: 116473 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116473 Log: PR c++/28736 PR c++/28737 PR c++/28738 * pt.c (process_template_parm): Store invalid template parameters as a TREE_LIST with a TREE_VALUE of error_mark_node. (push_inline_template_parms_recursive): Check for template parameters having a TREE_VALUE of error_mark_node rather than check the parameter itself. (mangle_class_name_for_template): Likewise. (comp_template_parms): When comparing the individual template parameters, return 1 if either is error_mark_node. (current_template_args): Robustify. (redeclare_class_template): Likewise. * g++.dg/template/void10.C: New test. * g++.dg/template/void8.C: New test. * g++.dg/template/void9.C: New test. * g++.dg/template/void3.C: Adjust error markers. * g++.dg/template/void4.C: Likewise. * g++.dg/template/crash55.C: Likewise. * g++.dg/template/void7.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/template/void10.C trunk/gcc/testsuite/g++.dg/template/void8.C trunk/gcc/testsuite/g++.dg/template/void9.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/crash55.C trunk/gcc/testsuite/g++.dg/template/void3.C trunk/gcc/testsuite/g++.dg/template/void4.C trunk/gcc/testsuite/g++.dg/template/void7.C
Fixed on mainline.