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/Sema/Sema.h b/lib/Sema/Sema.h
index 7d36291..33b3781 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -61,6 +61,7 @@
   class ExtVectorType;
   class TypedefDecl;
   class TemplateDecl;
+  class TemplateParameterList;
   class ObjCInterfaceDecl;
   class ObjCCompatibleAliasDecl;
   class ObjCProtocolDecl;
@@ -335,8 +336,7 @@
   virtual DeclTy *ActOnTag(Scope *S, unsigned TagSpec, TagKind TK,
                            SourceLocation KWLoc, const CXXScopeSpec &SS,
                            IdentifierInfo *Name, SourceLocation NameLoc,
-                           AttributeList *Attr,
-                           MultiTemplateParamsArg TemplateParameterLists);
+                           AttributeList *Attr);
   
   virtual void ActOnDefs(Scope *S, DeclTy *TagD, SourceLocation DeclStart,
                          IdentifierInfo *ClassName,
@@ -1505,6 +1505,20 @@
                              DeclTy **Params, unsigned NumParams,
                              SourceLocation RAngleLoc);
   
+  virtual DeclTy *
+  ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
+                     SourceLocation KWLoc, const CXXScopeSpec &SS,
+                     IdentifierInfo *Name, SourceLocation NameLoc,
+                     AttributeList *Attr,
+                     MultiTemplateParamsArg TemplateParameterLists);
+
+  bool TemplateParameterListsAreEqual(TemplateParameterList *New,
+                                      TemplateParameterList *Old,
+                                      bool Complain,
+                                      bool IsTemplateTemplateParm = false);
+  
+  bool CheckTemplateDeclScope(Scope *S, 
+                              MultiTemplateParamsArg &TemplateParameterLists);
 
   // Objective-C declarations.
   virtual DeclTy *ActOnStartClassInterface(SourceLocation AtInterfaceLoc,