Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63973 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index e95c106..8836106 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -247,9 +247,9 @@
   // Handle the template <...> part.
   SourceLocation TemplateLoc = ConsumeToken();
   TemplateParameterList TemplateParams; 
-  SourceLocation LParenLoc, RParenLoc;
-  if(!ParseTemplateParameters(Depth + 1, TemplateParams, LParenLoc,
-                              RParenLoc)) {
+  SourceLocation LAngleLoc, RAngleLoc;
+  if(!ParseTemplateParameters(Depth + 1, TemplateParams, LAngleLoc,
+                              RAngleLoc)) {
     return 0;
   }
 
@@ -288,8 +288,15 @@
     }
   }
 
+  TemplateParamsTy *ParamList = 
+    Actions.ActOnTemplateParameterList(Depth, SourceLocation(),
+                                       TemplateLoc, LAngleLoc,
+                                       &TemplateParams[0], 
+                                       TemplateParams.size(),
+                                       RAngleLoc);
+
   return Actions.ActOnTemplateTemplateParameter(CurScope, TemplateLoc,
-                                                &TemplateParams, ParamName,
+                                                ParamList, ParamName,
                                                 NameLoc, Depth, Position);
 }