Implement template instantiation for member class templates.

When performing template instantiation of the definitions of member
templates (or members thereof),  we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80389 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index e0798f6..4fa09d8 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -1243,7 +1243,8 @@
 
           TemplateArgumentList TemplateArgs(Context, Converted,
                                             /*TakeArgs=*/false);
-          ArgType = SubstType(ArgType, TemplateArgs,
+          ArgType = SubstType(ArgType, 
+                              MultiLevelTemplateArgumentList(TemplateArgs),
                               TTP->getDefaultArgumentLoc(),
                               TTP->getDeclName());
         }
@@ -1265,8 +1266,9 @@
         TemplateArgumentList TemplateArgs(Context, Converted,
                                           /*TakeArgs=*/false);
 
-        Sema::OwningExprResult E = SubstExpr(NTTP->getDefaultArgument(), 
-                                             TemplateArgs);
+        Sema::OwningExprResult E 
+          = SubstExpr(NTTP->getDefaultArgument(), 
+                      MultiLevelTemplateArgumentList(TemplateArgs));
         if (E.isInvalid())
           return true;