re PR c++/10845 (template member function (getting a nested template as parameter...
authorMark Mitchell <mark@codesourcery.com>
Fri, 20 Jun 2003 15:44:25 +0000 (15:44 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 20 Jun 2003 15:44:25 +0000 (15:44 +0000)
PR c++/10845
* pt.c (try_class_unification): Correct handling of member class
templates.

* semantics.c (genrtl_finish_function): Adjust
expand_function_end call.

From-SVN: r68269

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/member3.C [new file with mode: 0644]

index f92411253b665e9fa6e89c4a91ae1bcfa6ceab8e..8ed6d9c2260f44c1232e715f7a9595e31f2c9765 100644 (file)
@@ -1,3 +1,9 @@
+2003-06-20  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/10845
+       * pt.c (try_class_unification): Correct handling of member class
+       templates.
+
 2003-06-20  Nathan Sidwell  <nathan@codesourcery.com>
 
        * semantics.c (genrtl_finish_function): Adjust
index 1a43d020c594ca5053f1e796e3a77969233e035c..7ce9031e03335d30011f92dfe3a30b7809f6b56a 100644 (file)
@@ -9078,7 +9078,8 @@ try_class_unification (tree tparms, tree targs, tree parm, tree arg)
   tree copy_of_targs;
 
   if (!CLASSTYPE_TEMPLATE_INFO (arg)
-      || CLASSTYPE_TI_TEMPLATE (arg) != CLASSTYPE_TI_TEMPLATE (parm))
+      || (most_general_template (CLASSTYPE_TI_TEMPLATE (arg)) 
+         != most_general_template (CLASSTYPE_TI_TEMPLATE (parm))))
     return NULL_TREE;
 
   /* We need to make a new template argument vector for the call to
index 1e4cafa9446811753bfb077ac751d1cb328c5ae6..ff02c29a9c4c7f726585b3c7a22a466095d14375 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-20  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/10845
+       * g++.dg/template/member3.C: New test.
+
 2003-06-19  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/10939
diff --git a/gcc/testsuite/g++.dg/template/member3.C b/gcc/testsuite/g++.dg/template/member3.C
new file mode 100644 (file)
index 0000000..4f87e57
--- /dev/null
@@ -0,0 +1,19 @@
+template<typename T>
+struct A {
+  template<typename L> struct SubA { };
+
+  template<typename T1,typename L> void f(T1 & t1, SubA<L> & t2) { }
+  template<typename U> void g(SubA<U> & suba) { }
+  template<typename U> void h(SubA<U> & suba) { }
+};
+
+int main(void) {
+  int i;
+  A<int> a;
+  A<int>::SubA<int> suba;
+
+  a.f(i,suba);
+  a.g(suba);
+  a.h(suba);
+}
+