[Sema] ArrayRef-ize ActOnTemplateParameterList. NFC

llvm-svn: 256400
This commit is contained in:
Craig Topper 2015-12-24 23:58:25 +00:00
parent 6550a4b17e
commit 96225a5298
5 changed files with 12 additions and 14 deletions

View File

@ -5583,7 +5583,7 @@ public:
SourceLocation ExportLoc, SourceLocation ExportLoc,
SourceLocation TemplateLoc, SourceLocation TemplateLoc,
SourceLocation LAngleLoc, SourceLocation LAngleLoc,
Decl **Params, unsigned NumParams, ArrayRef<Decl *> Params,
SourceLocation RAngleLoc); SourceLocation RAngleLoc);
/// \brief The context in which we are checking a template parameter list. /// \brief The context in which we are checking a template parameter list.

View File

@ -1974,8 +1974,8 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
// Recover as if it were an explicit specialization. // Recover as if it were an explicit specialization.
TemplateParameterLists FakedParamLists; TemplateParameterLists FakedParamLists;
FakedParamLists.push_back(Actions.ActOnTemplateParameterList( FakedParamLists.push_back(Actions.ActOnTemplateParameterList(
0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None,
0, LAngleLoc)); LAngleLoc));
ThisDecl = ThisDecl =
Actions.ActOnTemplateDeclarator(getCurScope(), FakedParamLists, D); Actions.ActOnTemplateDeclarator(getCurScope(), FakedParamLists, D);

View File

@ -1662,8 +1662,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// "template<>", so that we treat this construct as a class // "template<>", so that we treat this construct as a class
// template specialization. // template specialization.
FakedParamLists.push_back(Actions.ActOnTemplateParameterList( FakedParamLists.push_back(Actions.ActOnTemplateParameterList(
0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None,
0, LAngleLoc)); LAngleLoc));
TemplateParams = &FakedParamLists; TemplateParams = &FakedParamLists;
} }
} }

View File

@ -126,8 +126,7 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context,
Actions.ActOnTemplateParameterList(CurTemplateDepthTracker.getDepth(), Actions.ActOnTemplateParameterList(CurTemplateDepthTracker.getDepth(),
ExportLoc, ExportLoc,
TemplateLoc, LAngleLoc, TemplateLoc, LAngleLoc,
TemplateParams.data(), TemplateParams, RAngleLoc));
TemplateParams.size(), RAngleLoc));
if (!TemplateParams.empty()) { if (!TemplateParams.empty()) {
isSpecialization = false; isSpecialization = false;
@ -280,8 +279,8 @@ Parser::ParseSingleDeclarationAfterTemplate(
// Recover as if it were an explicit specialization. // Recover as if it were an explicit specialization.
TemplateParameterLists FakedParamLists; TemplateParameterLists FakedParamLists;
FakedParamLists.push_back(Actions.ActOnTemplateParameterList( FakedParamLists.push_back(Actions.ActOnTemplateParameterList(
0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, nullptr, 0, SourceLocation(), TemplateInfo.TemplateLoc, LAngleLoc, None,
0, LAngleLoc)); LAngleLoc));
return ParseFunctionDefinition( return ParseFunctionDefinition(
DeclaratorInfo, ParsedTemplateInfo(&FakedParamLists, DeclaratorInfo, ParsedTemplateInfo(&FakedParamLists,
@ -631,8 +630,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
TemplateParameterList *ParamList = TemplateParameterList *ParamList =
Actions.ActOnTemplateParameterList(Depth, SourceLocation(), Actions.ActOnTemplateParameterList(Depth, SourceLocation(),
TemplateLoc, LAngleLoc, TemplateLoc, LAngleLoc,
TemplateParams.data(), TemplateParams,
TemplateParams.size(),
RAngleLoc); RAngleLoc);
// Grab a default argument (if available). // Grab a default argument (if available).

View File

@ -814,14 +814,14 @@ Sema::ActOnTemplateParameterList(unsigned Depth,
SourceLocation ExportLoc, SourceLocation ExportLoc,
SourceLocation TemplateLoc, SourceLocation TemplateLoc,
SourceLocation LAngleLoc, SourceLocation LAngleLoc,
Decl **Params, unsigned NumParams, ArrayRef<Decl *> Params,
SourceLocation RAngleLoc) { SourceLocation RAngleLoc) {
if (ExportLoc.isValid()) if (ExportLoc.isValid())
Diag(ExportLoc, diag::warn_template_export_unsupported); Diag(ExportLoc, diag::warn_template_export_unsupported);
return TemplateParameterList::Create(Context, TemplateLoc, LAngleLoc, return TemplateParameterList::Create(Context, TemplateLoc, LAngleLoc,
(NamedDecl**)Params, NumParams, (NamedDecl**)Params.data(),
RAngleLoc); Params.size(), RAngleLoc);
} }
static void SetNestedNameSpecifier(TagDecl *T, const CXXScopeSpec &SS) { static void SetNestedNameSpecifier(TagDecl *T, const CXXScopeSpec &SS) {