aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-18 22:27:09 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-18 22:27:09 +0000
commit22eaced5cac3cf0522c953f593419fc6cf184aaf (patch)
treecdca4582f7ebc121213dd15c00092b13daca2635 /lib/Sema/SemaTemplateDeduction.cpp
parent0ecc2e9ce86b0705bc1a53a9c8f90c433bcdca1b (diff)
Once we've collected the template arguments for a
partially-substituted parameter pack in a template, forget about the partially-substituted parameter pack: it is now completed. Fixes <rdar://problem/12176336>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 67ea68928d..00a48e9396 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -2647,11 +2647,15 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
if (CurrentInstantiationScope &&
CurrentInstantiationScope->getPartiallySubstitutedPack(&ExplicitArgs,
&NumExplicitArgs)
- == Param)
+ == Param) {
Builder.push_back(TemplateArgument(ExplicitArgs, NumExplicitArgs));
- else
- Builder.push_back(TemplateArgument::getEmptyPack());
+ // Forget the partially-substituted pack; it's substitution is now
+ // complete.
+ CurrentInstantiationScope->ResetPartiallySubstitutedPack();
+ } else {
+ Builder.push_back(TemplateArgument::getEmptyPack());
+ }
continue;
}