From 87dd697dcc8ecb64df73ae64d61b8c80ff0c157c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 20 Dec 2010 16:52:59 +0000 Subject: Clean up the handling of template argument packs, especially in the area of printing template arguments. The functionality changes here are limited to cases of variadic templates that aren't yet enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122250 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ASTContext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/AST/ASTContext.cpp') diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 94038418df..8e2ef1a95e 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2741,6 +2741,9 @@ ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) { return TemplateArgument(getCanonicalType(Arg.getAsType())); case TemplateArgument::Pack: { + if (Arg.pack_size() == 0) + return Arg; + TemplateArgument *CanonArgs = new (*this) TemplateArgument[Arg.pack_size()]; unsigned Idx = 0; -- cgit v1.2.3-70-g09d2