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/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index 3949395..d005ca3 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -22,19 +22,25 @@
 // TemplateParameterList Implementation
 //===----------------------------------------------------------------------===//
 
-TemplateParameterList::TemplateParameterList(Decl **Params, unsigned NumParams)
-  : NumParams(NumParams) {
+TemplateParameterList::TemplateParameterList(SourceLocation TemplateLoc,
+                                             SourceLocation LAngleLoc,
+                                             Decl **Params, unsigned NumParams,
+                                             SourceLocation RAngleLoc)
+  : TemplateLoc(TemplateLoc), LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc),
+    NumParams(NumParams) {
   for (unsigned Idx = 0; Idx < NumParams; ++Idx)
     begin()[Idx] = Params[Idx];
 }
 
 TemplateParameterList *
-TemplateParameterList::Create(ASTContext &C, Decl **Params,
-                              unsigned NumParams) {
+TemplateParameterList::Create(ASTContext &C, SourceLocation TemplateLoc,
+                              SourceLocation LAngleLoc, Decl **Params,
+                              unsigned NumParams, SourceLocation RAngleLoc) {
   unsigned Size = sizeof(TemplateParameterList) + sizeof(Decl *) * NumParams;
   unsigned Align = llvm::AlignOf<TemplateParameterList>::Alignment;
   void *Mem = C.Allocate(Size, Align);
-  return new (Mem) TemplateParameterList(Params, NumParams);
+  return new (Mem) TemplateParameterList(TemplateLoc, LAngleLoc, Params, 
+                                         NumParams, RAngleLoc);
 }
 
 //===----------------------------------------------------------------------===//