diff options
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index d1f87a2c18..6d54d403aa 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -28,7 +28,7 @@ CXXRecordDecl *Sema::createLambdaClosureType(SourceRange IntroducerRange) { // Start constructing the lambda class. CXXRecordDecl *Class = CXXRecordDecl::CreateLambda(Context, DC, IntroducerRange.getBegin()); - CurContext->addDecl(Class); + DC->addDecl(Class); return Class; } @@ -65,7 +65,7 @@ CXXMethodDecl *Sema::startLambdaDefinition(CXXRecordDecl *Class, // Temporarily set the lexical declaration context to the current // context, so that the Scope stack matches the lexical nesting. - Method->setLexicalDeclContext(Class->getDeclContext()); + Method->setLexicalDeclContext(CurContext); // Add parameters. if (!Params.empty()) { |