The following invalid testcase triggers an ICE on mainline: ========================================= template<int,void> struct A {}; template<int N> struct A<N,0> {}; ========================================= bug.cc:1: error: 'void' is not a valid type for a template constant parameter bug.cc:3: error: partial specialization 'A<N, <expression error> >' does not specialize any template arguments bug.cc:3: internal compiler error: tree check: expected tree_list, have error_mark in process_partial_specialization, at cp/pt.c:2737 Please submit a full bug report, [etc.] The ICE happens in the same function as PR 28737, but in a different position. This is probably fallout from PR 27668.
Confirmed. I'll take a look at it.
Subject: Bug 28738 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.