Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64185 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index af41796..c2051a5 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -746,7 +746,9 @@
   if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(D))
     return Owned(BuildDeclRefExpr(Ovl, Context.OverloadTy, Loc,
                                   false, false, SS));
-
+  else if (TemplateDecl *Template = dyn_cast<TemplateDecl>(D))
+    return Owned(BuildDeclRefExpr(Template, Context.OverloadTy, Loc,
+                                  false, false, SS));
   ValueDecl *VD = cast<ValueDecl>(D);
 
   // check if referencing an identifier with __attribute__((deprecated)).