From 203e6a322ae29d577acafcb1572a57ec16e1e730 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 11 Jan 2011 23:09:57 +0000 Subject: Add TemplateArgument::CreatePackCopy() to create a new parameter pack in ASTContext-allocated memory, copying the provided template arguments. Use this new routine where we can. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123289 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclTemplate.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/AST/DeclTemplate.cpp') diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp index b7a586cb17..6e08854231 100644 --- a/lib/AST/DeclTemplate.cpp +++ b/lib/AST/DeclTemplate.cpp @@ -338,11 +338,8 @@ ClassTemplateDecl::getInjectedClassNameSpecialization() { Arg = TemplateArgument(TemplateName(TTP), TTP->isParameterPack()); } - if ((*Param)->isTemplateParameterPack()) { - TemplateArgument *Pack = new (Context) TemplateArgument [1]; - *Pack = Arg; - Arg = TemplateArgument(Pack, 1); - } + if ((*Param)->isTemplateParameterPack()) + Arg = TemplateArgument::CreatePackCopy(Context, &Arg, 1); TemplateArgs.push_back(Arg); } -- cgit v1.2.3-70-g09d2