diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-11-07 23:05:16 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-11-07 23:05:16 +0000 |
| commit | 1ccc8416a02475d7c9cc692bdb7fffe6aa7a6a37 (patch) | |
| tree | 94fb124fe766ec7aecc9463a661c9f2950649e82 /clang/lib/AST/ASTContext.cpp | |
| parent | 1c76c59bbc056c65f2e344741a3cd61e7aead88f (diff) | |
| download | bcm5719-llvm-1ccc8416a02475d7c9cc692bdb7fffe6aa7a6a37.tar.gz bcm5719-llvm-1ccc8416a02475d7c9cc692bdb7fffe6aa7a6a37.zip | |
Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.
But don't get too excited about that happening now.
llvm-svn: 118385
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 8f87b2f23b8..b2451a2d867 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2684,17 +2684,15 @@ ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) { return TemplateArgument(getCanonicalType(Arg.getAsType())); case TemplateArgument::Pack: { - // FIXME: Allocate in ASTContext - TemplateArgument *CanonArgs = new TemplateArgument[Arg.pack_size()]; + TemplateArgument *CanonArgs + = new (*this) TemplateArgument[Arg.pack_size()]; unsigned Idx = 0; for (TemplateArgument::pack_iterator A = Arg.pack_begin(), AEnd = Arg.pack_end(); A != AEnd; (void)++A, ++Idx) CanonArgs[Idx] = getCanonicalTemplateArgument(*A); - TemplateArgument Result; - Result.setArgumentPack(CanonArgs, Arg.pack_size(), false); - return Result; + return TemplateArgument(CanonArgs, Arg.pack_size()); } } @@ -3897,8 +3895,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, const TemplateArgumentList &TemplateArgs = Spec->getTemplateArgs(); std::string TemplateArgsStr = TemplateSpecializationType::PrintTemplateArgumentList( - TemplateArgs.getFlatArgumentList(), - TemplateArgs.flat_size(), + TemplateArgs.data(), + TemplateArgs.size(), (*this).PrintingPolicy); S += TemplateArgsStr; |

