Canonicalize template template parameters when canonicalizing a
template name that refers to such a parameter. It's amazing that this
problem didn't surface earlier. Fixes PR7387.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/member-function-template.cpp b/test/SemaTemplate/member-function-template.cpp
index aea6285..44954ed 100644
--- a/test/SemaTemplate/member-function-template.cpp
+++ b/test/SemaTemplate/member-function-template.cpp
@@ -85,3 +85,19 @@
 
   void test_f(X<3> x, Y<int> y) { x.f(y); }
 }
+
+namespace PR7387 {
+  template <typename T> struct X {};
+
+  template <typename T1> struct S {
+    template <template <typename> class TC> void foo(const TC<T1>& arg);
+  };
+
+  template <typename T1> template <template <typename> class TC>
+  void S<T1>::foo(const TC<T1>& arg) {}
+
+  void test(const X<int>& x) {
+    S<int> s;
+    s.foo(x);
+  }
+}