The following invalid code snippet triggers an ICE since at least GCC 2.95.3:
=================================== template<typename> struct A {}; template<typename> struct A<int> { template<int> void foo(); }; void bar() { A<int> a; a.foo<0>(); } =================================== bug.cc:3: error: template parameters not used in partial specialization: bug.cc:3: error: '<template-parameter-1-1>' bug.cc: In function 'void bar()': bug.cc:11: internal compiler error: in retrieve_specialization, at cp/pt.c:899 Please submit a full bug report, [etc.] -- Summary: ICE with invalid template specialization Product: gcc Version: 4.3.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=34272