Bug 18962 - [3.4 Regression] specialization of template class with inner template members and parameter
Summary: [3.4 Regression] specialization of template class with inner template members...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 3.4.4
Assignee: Alexandre Oliva
URL:
Keywords: patch, rejects-valid
: 19426 19731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-13 18:07 UTC by Andrew Pinski
Modified: 2005-01-31 22:46 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.0
Known to fail: 3.3.3 3.4.0
Last reconfirmed: 2004-12-13 18:08:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-12-13 18:07:37 UTC
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).
Comment 1 Andrew Pinski 2004-12-13 18:08:03 UTC
Confirmed, this was just a split off from PR 18950.
Comment 2 Andrew Pinski 2004-12-22 16:34:45 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01713.html>.
Comment 3 CVS Commits 2004-12-23 16:13:20 UTC
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

Comment 4 Andrew Pinski 2004-12-23 16:25:19 UTC
Fixed at least on the mainline.
Comment 5 CVS Commits 2004-12-23 20:06:17 UTC
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

Comment 6 Andrew Pinski 2004-12-23 20:37:16 UTC
Fixed.
Comment 7 Andrew Pinski 2005-01-13 14:39:32 UTC
*** Bug 19426 has been marked as a duplicate of this bug. ***
Comment 8 Andrew Pinski 2005-01-31 22:46:15 UTC
*** Bug 19731 has been marked as a duplicate of this bug. ***