diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-09 01:28:42 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-09 01:28:42 +0000 |
commit | ab23d9a9bed4a025e811b2503f0ad6ef1047a1ff (patch) | |
tree | 1e8e2b6bfbaa9bb45d5f2cae7344b48e28884ae3 | |
parent | 9390e9cc499bddd4898669126caa590f33efb29b (diff) | |
download | bcm5719-llvm-ab23d9a9bed4a025e811b2503f0ad6ef1047a1ff.tar.gz bcm5719-llvm-ab23d9a9bed4a025e811b2503f0ad6ef1047a1ff.zip |
Along the error path for lambdas, mark the lambda class as invalid and finalize it
llvm-svn: 150130
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index b90f5e3d639..033bf4ab3c1 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/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(); } |