Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.
Removed the ActOnClassTemplate action, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 4d57680..1df8b63 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -65,8 +65,9 @@
}
void DependentSizedExtVectorType::Destroy(ASTContext& C) {
- if (SizeExpr)
- SizeExpr->Destroy(C);
+ // FIXME: Deallocate size expression, once we're cloning properly.
+// if (SizeExpr)
+// SizeExpr->Destroy(C);
this->~DependentSizedExtVectorType();
C.Deallocate(this);
}
diff --git a/lib/Frontend/PrintParserCallbacks.cpp b/lib/Frontend/PrintParserCallbacks.cpp
index 170ab5e..51693cc 100644
--- a/lib/Frontend/PrintParserCallbacks.cpp
+++ b/lib/Frontend/PrintParserCallbacks.cpp
@@ -197,6 +197,7 @@
SourceLocation KWLoc, const CXXScopeSpec &SS,
IdentifierInfo *Name, SourceLocation NameLoc,
AttributeList *Attr, AccessSpecifier AS,
+ MultiTemplateParamsArg TemplateParamLists,
bool &Owned) {
// TagType is an instance of DeclSpec::TST, indicating what kind of tag this
// is (struct/union/enum/class).
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 75831cc..9d13e98 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1587,6 +1587,7 @@
bool Owned = false;
DeclPtrTy TagDecl = Actions.ActOnTag(CurScope, DeclSpec::TST_enum, TK,
StartLoc, SS, Name, NameLoc, Attr, AS,
+ Action::MultiTemplateParamsArg(Actions),
Owned);
if (Tok.is(tok::l_brace))
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 9f3eff9..d66e642 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2084,13 +2084,12 @@
TemplateParameterList **ParamLists,
unsigned NumParamLists);
- virtual DeclResult
- ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
- SourceLocation KWLoc, const CXXScopeSpec &SS,
- IdentifierInfo *Name, SourceLocation NameLoc,
- AttributeList *Attr,
- MultiTemplateParamsArg TemplateParameterLists,
- AccessSpecifier AS);
+ DeclResult CheckClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
+ SourceLocation KWLoc, const CXXScopeSpec &SS,
+ IdentifierInfo *Name, SourceLocation NameLoc,
+ AttributeList *Attr,
+ MultiTemplateParamsArg TemplateParameterLists,
+ AccessSpecifier AS);
QualType CheckTemplateIdType(TemplateName Template,
SourceLocation TemplateLoc,
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 760a95f..e38047c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3665,7 +3665,7 @@
// This is a declaration or definition of a class template (which may
// be a member of another template).
OwnedDecl = false;
- DeclResult Result = ActOnClassTemplate(S, TagSpec, TK, KWLoc,
+ DeclResult Result = CheckClassTemplate(S, TagSpec, TK, KWLoc,
SS, Name, NameLoc, Attr,
move(TemplateParameterLists),
AS);
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 981b850..9ab6164 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -409,7 +409,7 @@
}
Sema::DeclResult
-Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
+Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
SourceLocation KWLoc, const CXXScopeSpec &SS,
IdentifierInfo *Name, SourceLocation NameLoc,
AttributeList *Attr,
@@ -2491,7 +2491,7 @@
<< (TK == TK_Definition)
<< CodeModificationHint::CreateRemoval(SourceRange(LAngleLoc,
RAngleLoc));
- return ActOnClassTemplate(S, TagSpec, TK, KWLoc, SS,
+ return CheckClassTemplate(S, TagSpec, TK, KWLoc, SS,
ClassTemplate->getIdentifier(),
TemplateNameLoc,
Attr,