diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-25 03:56:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-25 03:56:55 +0000 |
commit | 612409ece080e814f79e06772c690d603f45fbd6 (patch) | |
tree | 537d937d27dae8aec0b0bdf586cd8f2dfaaa9d59 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 6f36366c85dc81d67d70efdeeea4cfc382053feb (diff) |
PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index d009e2f81b..082b2e847f 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -838,6 +838,19 @@ namespace { return move(Result); } + ExprResult TransformLambdaExpr(LambdaExpr *E) { + LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true); + return TreeTransform<TemplateInstantiator>::TransformLambdaExpr(E); + } + + ExprResult TransformLambdaScope(LambdaExpr *E, + CXXMethodDecl *CallOperator) { + CallOperator->setInstantiationOfMemberFunction(E->getCallOperator(), + TSK_ImplicitInstantiation); + return TreeTransform<TemplateInstantiator>:: + TransformLambdaScope(E, CallOperator); + } + private: ExprResult transformNonTypeTemplateParmRef(NonTypeTemplateParmDecl *parm, SourceLocation loc, |