diff options
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index b90f5e3d63..033bf4ab3c 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -265,6 +265,16 @@ void Sema::ActOnLambdaError(SourceLocation StartLoc, Scope *CurScope) { // Leave the context of the lambda. PopDeclContext(); + + // Finalize the lambda. + LambdaScopeInfo *LSI = getCurLambda(); + CXXRecordDecl *Class = LSI->Lambda; + Class->setInvalidDecl(); + SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end()); + ActOnFields(0, Class->getLocation(), Class, Fields, + SourceLocation(), SourceLocation(), 0); + CheckCompletedCXXClass(Class); + PopFunctionScopeInfo(); } |