diff options
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 16 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 10 |
2 files changed, 11 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 035c37cfe6e..40eab8cf999 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -3733,9 +3733,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template, // We're done with this parameter pack. Pack up its arguments and add // them to the list. Converted.push_back( - TemplateArgument::CreatePackCopy(Context, - ArgumentPack.data(), - ArgumentPack.size())); + TemplateArgument::CreatePackCopy(Context, ArgumentPack)); ArgumentPack.clear(); // This argument is assigned to the next parameter. @@ -3816,10 +3814,9 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template, // If we're checking a partial template argument list, we're done. if (PartialTemplateArgs) { if ((*Param)->isTemplateParameterPack() && !ArgumentPack.empty()) - Converted.push_back(TemplateArgument::CreatePackCopy(Context, - ArgumentPack.data(), - ArgumentPack.size())); - + Converted.push_back( + TemplateArgument::CreatePackCopy(Context, ArgumentPack)); + return false; } @@ -3835,9 +3832,8 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template, if (Param + 1 != ParamEnd) return true; - Converted.push_back(TemplateArgument::CreatePackCopy(Context, - ArgumentPack.data(), - ArgumentPack.size())); + Converted.push_back( + TemplateArgument::CreatePackCopy(Context, ArgumentPack)); ArgumentPack.clear(); ++Param; diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index ae8157e70a6..cc17ab84201 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -679,7 +679,7 @@ public: new (S.Context) TemplateArgument[Pack.New.size()]; std::copy(Pack.New.begin(), Pack.New.end(), ArgumentPack); NewPack = DeducedTemplateArgument( - TemplateArgument(ArgumentPack, Pack.New.size()), + TemplateArgument(llvm::makeArrayRef(ArgumentPack, Pack.New.size())), Pack.New[0].wasDeducedFromArrayBound()); } @@ -2075,9 +2075,8 @@ ConvertDeducedTemplateArgument(Sema &S, NamedDecl *Param, } // Create the resulting argument pack. - Output.push_back(TemplateArgument::CreatePackCopy(S.Context, - PackedArgsBuilder.data(), - PackedArgsBuilder.size())); + Output.push_back( + TemplateArgument::CreatePackCopy(S.Context, PackedArgsBuilder)); return false; } @@ -2850,7 +2849,8 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, CurrentInstantiationScope->getPartiallySubstitutedPack(&ExplicitArgs, &NumExplicitArgs) == Param) { - Builder.push_back(TemplateArgument(ExplicitArgs, NumExplicitArgs)); + Builder.push_back(TemplateArgument( + llvm::makeArrayRef(ExplicitArgs, NumExplicitArgs))); // Forget the partially-substituted pack; it's substitution is now // complete. |

