------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-18 15:16 ------- Further reduced testcase:
================================================== template<int> struct A { enum { e }; template<int> void foo(); }; template<> template<int> void A<0>::foo() {} ================================================== This is probably the same underlying problem as in PR14494. PR14494 can be reduced to ================================================== template<int> struct A { template<int> void foo(); }; template<> template<int N> void A<0>::foo<N>() {} ================================================== which results in the following bogus error message: PR14494A.cc:10: error: function template partial specialization 'foo<N>' is not allowed PR14494A.cc:10: error: no 'void A<0>::foo()' member function declared in class 'A<0>' PR14494A.cc:10: error: invalid function declaration A similar version is the following: ================================================== template<int> struct A { template<int> void foo(); }; template<> template<int> void A<0>::foo() {} ================================================== which results in the following bogus error message: PR14494B.cc:10: error: template-id 'foo<>' for 'void A<0>::foo()' does not match any template declaration PR14494B.cc:10: error: invalid function declaration Btw, the underlying problem is not a regression. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |reichelt at gcc dot gnu dot | |org BugsThisDependsOn| |14494 Keywords| |monitored http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19487