Implement partial ordering of class template partial specializations 
(C++ [temp.class.order]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81866 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index dbb5661..af00cb9 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -797,12 +797,12 @@
   bool Invalid = false;
 
   unsigned N = L->size();
-  typedef llvm::SmallVector<Decl*,8> ParamVector;
+  typedef llvm::SmallVector<NamedDecl *, 8> ParamVector;
   ParamVector Params;
   Params.reserve(N);
   for (TemplateParameterList::iterator PI = L->begin(), PE = L->end();
        PI != PE; ++PI) {
-    Decl *D = Visit(*PI);
+    NamedDecl *D = cast_or_null<NamedDecl>(Visit(*PI));
     Params.push_back(D);
     Invalid = Invalid || !D;
   }