Add test for PR8629

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124204 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-template-template-parm.cpp b/test/SemaTemplate/instantiate-template-template-parm.cpp
index 1e33469..a70c7e8 100644
--- a/test/SemaTemplate/instantiate-template-template-parm.cpp
+++ b/test/SemaTemplate/instantiate-template-template-parm.cpp
@@ -59,3 +59,39 @@
 };
 
 Comp<int, lt> c0;
+
+namespace PR8629 {
+  template<template<int> class TT> struct X0
+  {
+    static void apply();
+  };
+  template<int> struct Type { };
+
+  template<class T> struct X1
+  {
+    template<class U> struct Inner;
+
+    template<class U> void g()
+    {
+      typedef Inner<U> Init;
+      X0<Init::template VeryInner>::apply();
+    }
+    template<int N> void f ()
+    {
+      g<Type<N> >();
+    }
+  };
+  template<class T> template<class U> struct X1<T>::Inner
+  {
+    template<int> struct VeryInner {
+    };
+  };
+  struct X1Container
+  {
+    X1Container()
+    {
+      simplex_.f<0>();
+    }
+    X1<double> simplex_;
+  };
+}