The following invalid testcase triggers an ICE on mainline: ========================================= template<void> struct A { template<int> struct B {}; };
template<> template<int> struct A<int>::B {}; template<> template<> struct A<int>::B<0> {}; ========================================= bug.cc:1: error: 'void' is not a valid type for a template constant parameter bug.cc:6: error: expected 2 levels of template parms for 'struct A<<template parameter error> >::B<<anonymous> >', got 1 bug.cc:6: error: redefinition of 'struct A<<template parameter error> >::B<<anonymous> >' bug.cc:3: error: previous definition of 'struct A<<template parameter error> >::B<<anonymous> >' bug.cc:8: internal compiler error: in lookup_template_class, at cp/pt.c:4555 Please submit a full bug report, [etc.] If I remove line 6 the ICE happens in the same spot as PR 28736, so these problems are maybe related. This is probably fallout from PR 27668. -- Summary: [4.2 regression] ICE specializing template member of invalid template class Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, error-recovery, monitored Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org BugsThisDependsOn: 27668 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28739