aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-12-23 16:12:57 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-12-23 16:12:57 +0000
commit08167d1cdbfaf763a8bede8fd46c870356a921f5 (patch)
tree9456b71999f04d8db4d56c178ba79cff15a371f7 /gcc
parentfaa003343e09656a6b0174c00305073823f2fd0c (diff)
downloadgcc-08167d1cdbfaf763a8bede8fd46c870356a921f5.zip
gcc-08167d1cdbfaf763a8bede8fd46c870356a921f5.tar.gz
gcc-08167d1cdbfaf763a8bede8fd46c870356a921f5.tar.bz2
re PR c++/18962 (specialization of template class with inner template members and parameter)
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. From-SVN: r92552
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/spec19.C23
4 files changed, 37 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2d6e1af0..c8e448f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/18962
+ * pt.c (check_explicit_specialization): Use the argument list from
+ the definition in a template function specialization definition.
+
2004-12-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/18733
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 07cdd5d..3c6f5bc 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -2059,6 +2059,10 @@ check_explicit_specialization (tree declarator,
DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (tmpl))
= DECL_SOURCE_LOCATION (decl);
+ /* We want to use the argument list specified in the
+ definition, not in the original declaration. */
+ DECL_ARGUMENTS (DECL_TEMPLATE_RESULT (tmpl))
+ = DECL_ARGUMENTS (decl);
}
return tmpl;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 45620fd..3a91de1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2004-12-23 Alexandre Oliva <aoliva@redhat.com>
+ * g++.dg/template/spec19.C: New.
+
+2004-12-23 Alexandre Oliva <aoliva@redhat.com>
+
PR target/16891
* gcc.dg/empty2.c: New.
diff --git a/gcc/testsuite/g++.dg/template/spec19.C b/gcc/testsuite/g++.dg/template/spec19.C
new file mode 100644
index 0000000..c560b01
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/spec19.C
@@ -0,0 +1,23 @@
+// PR c++/18962
+
+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; // make sure we use the argument list from the definition.
+}
+
+int main()
+{
+ Class<int,1> instance;
+ Class<char,2> param;
+ instance.function( param );
+}