This should compile, it does with 3.3.2 but not with 3.4.0 and 4.0.0 template<class T1,int N1> class Class { public: template <class T2,int N2> void function( const Class<T2,N2>& ); }; template<> template<class T2,int N2> void Class<int,1>::function( const Class<T2,N2>& param ) { param;// line 12 } int main() { Class<int,1> instance; Class<char,2> param; instance.function( param ); } This is a regression from the begining of this year: : Search converges between 2004-03-01-trunk (#446) and 2004-04-01-trunk (#447). : Search converges between 2004-03-15-3.4 (#3) and 2004-04-01-3.4 (#4).
Confirmed, this was just a split off from PR 18950.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01713.html>.
Subject: Bug 18962 CVSROOT: /cvs/gcc Module name: gcc Changes by: aoliva@gcc.gnu.org 2004-12-23 16:12:57 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: spec19.C Log message: gcc/cp/ChangeLog: PR c++/18962 * pt.c (check_explicit_specialization): Use the argument list from the definition in a template function specialization definition. gcc/testsuite/ChangeLog: * g++.dg/template/spec19.C: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4554&r2=1.4555 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.960&r2=1.961 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4804&r2=1.4805 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/spec19.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed at least on the mainline.
Subject: Bug 18962 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: aoliva@gcc.gnu.org 2004-12-23 20:06:11 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: spec19.C Log message: gcc/cp/ChangeLog: PR c++/18962 * pt.c (check_explicit_specialization): Use the argument list from the definition in a template function specialization definition. gcc/testsuite/ChangeLog: * g++.dg/template/spec19.C: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.187&r2=1.3892.2.188 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.47&r2=1.816.2.48 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.335&r2=1.3389.2.336 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/spec19.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Fixed.
*** Bug 19426 has been marked as a duplicate of this bug. ***
*** Bug 19731 has been marked as a duplicate of this bug. ***