aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-22 21:19:48 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-22 21:19:48 +0000
commite02e26293cf8e3bad1059b39cea75c6582896da6 (patch)
treee7e1852ce7aeaea89a2db8f5bdcbf2c2f07c41c3 /lib/Sema/SemaTemplateInstantiate.cpp
parente6913d385e2401f4f680b7ae1ca3bf360879c786 (diff)
Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing template arguments using the pattern of the pack expansion, then bundling the resulting deductions into an argument pack. We can now handle a variety of simple list-handling metaprograms using variadic templates. See, e.g., the new "count" metaprogram. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 2fa4ac5b0b..16e1faa7f9 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1723,12 +1723,13 @@ Sema::SubstTemplateName(TemplateName Name, SourceLocation Loc,
return Instantiator.TransformTemplateName(Name);
}
-bool Sema::Subst(const TemplateArgumentLoc &Input, TemplateArgumentLoc &Output,
+bool Sema::Subst(const TemplateArgumentLoc *Args, unsigned NumArgs,
+ TemplateArgumentListInfo &Result,
const MultiLevelTemplateArgumentList &TemplateArgs) {
TemplateInstantiator Instantiator(*this, TemplateArgs, SourceLocation(),
DeclarationName());
-
- return Instantiator.TransformTemplateArgument(Input, Output);
+
+ return Instantiator.TransformTemplateArguments(Args, NumArgs, Result);
}
Decl *LocalInstantiationScope::getInstantiationOf(const Decl *D) {