The following testcase causes an ICE on the 4.1 branch and mainline: ======================================================== template<int> struct A { template<typename> void foo(); };
template<> template<struct T> void A<0>::foo() {} ======================================================== bug.cc:6: error: 'struct T' is not a valid type for a template constant parameter bug.cc:6: internal compiler error: in check_classfn, at cp/decl2.c:575 Please submit a full bug report, [etc.] This is a very recent regression, since GCC 4.1.1 is not affected. Mark, your patch for PR 20173 seems to have caused this: http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01204.html -- Summary: [4.0/4.1 regression] ICE with invalid template parameter in specialization Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, error-recovery, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27962