The following C++ code should not compile: template<class T1> class C { template<class T2> class C2 { }; };
template<> template<class X, class Y> class C<int>::C2 { }; template<> template<int> class C<float>::C2 { }; The first specialization has too many parameters. the second specialization has the wrong type of parameters. The C++ standard clause 14.7.3/18 says they parameters must have the same types. I would assume that includes whether they exist, or not. -- Summary: Partial explicit specialization template parameters not checked Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: andrew dot stubbs at st dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32071