summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commitcaddba9f00d71d8b2986f263a10c4b249d326b57 (patch)
treecd5cd4c0d8a56803695910182199bc9980d160d6 /clang/lib/Sema
parent9fa426a666ce928ff968a77ac17458f275f6e0ff (diff)
downloadbcm5719-llvm-caddba9f00d71d8b2986f263a10c4b249d326b57.tar.gz
bcm5719-llvm-caddba9f00d71d8b2986f263a10c4b249d326b57.zip
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>. llvm-svn: 172859
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 67ea68928da..00a48e9396b 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud