Patch for problems with partial specialization of templates with template parameters
Kriang Lerdsuwanakij
lerdsuwa@scf-fs.usc.edu
Wed Feb 18 23:56:00 GMT 1998
Hi
Here is the patch that fix the partial specialization bug reported
earlier.
Kriang
=======================================================
* pt.c (unify): Handle TEMPLATE_DECL.
diff -rNpc gcc-old/cp/pt.c gcc/cp/pt.c
*** gcc-old/cp/pt.c Wed Feb 18 16:24:52 1998
--- gcc/cp/pt.c Wed Feb 18 16:24:03 1998
*************** unify (tparms, targs, ntparms, parm, arg
*** 5218,5223 ****
--- 5218,5227 ----
return 1;
return 0;
+ case TEMPLATE_DECL:
+ /* Matched cases are handled by the ARG == PARM test above. */
+ return 1;
+
default:
sorry ("use of `%s' in template type unification",
tree_code_name [(int) TREE_CODE (parm)]);
diff -rNpc gcc-old/testsuite/g++.old-deja/g++.pt/ttp42.C
gcc/testsuite/g++.old-deja/g++.pt/ttp42.C
*** gcc-old/testsuite/g++.old-deja/g++.pt/ttp42.C Wed Dec 31 16:00:00
1969
--- gcc/testsuite/g++.old-deja/g++.pt/ttp42.C Wed Feb 18 16:26:33 1998
***************
*** 0 ****
--- 1,21 ----
+ template <class T, template <class T> class C>
+ struct X
+ {};
+
+ template <class T>
+ struct Y
+ {};
+
+ template <class T>
+ struct Z
+ {};
+
+ template <class T>
+ struct X<T,Y>
+ {};
+
+ int main()
+ {
+ X<int,Y> a;
+ X<int,Z> b;
+ }
More information about the Gcc
mailing list