summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-09-28 04:31:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-09-28 04:31:26 +0000
commit39edfeb34b0b0b8033179e35cf13cd5d95d56fa8 (patch)
treeb1d17574e94fbc198ecfb8447fc1f1962a8aea64 /lib/Sema/SemaLambda.cpp
parent04fa7a33279808dc3e5117c41b5f84c40eeb7362 (diff)
Switch from putting init capture VarDecls in the surrounding DeclContext to
putting them in the call operator's DeclContext. This better matches the language wording and avoids some cases where code gets confused by them for namespace-scope lambdas and the like. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 08048d54d9..a87c903d3b 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -514,7 +514,7 @@ VarDecl *Sema::checkInitCapture(SourceLocation Loc, bool ByRef,
// used as a variable, and only exists as a way to name and refer to the
// init-capture.
// FIXME: Pass in separate source locations for '&' and identifier.
- VarDecl *NewVD = VarDecl::Create(Context, CurContext->getLexicalParent(), Loc,
+ VarDecl *NewVD = VarDecl::Create(Context, CurContext, Loc,
Loc, Id, TSI->getType(), TSI, SC_Auto);
NewVD->setInitCapture(true);
NewVD->setReferenced(true);