aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-09 01:28:42 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-09 01:28:42 +0000
commit630d5fffdf342128bd73f817013ee91e030daac1 (patch)
tree05c451c977337ce05fed1ce3b9b58cc4914545e5 /lib/Sema/SemaLambda.cpp
parentdcffcbf790b9d948a393904a5dca0a056823f927 (diff)
Along the error path for lambdas, mark the lambda class as invalid and finalize it
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp10
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();
}