summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-08 20:17:14 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-08 20:17:14 +0000
commit21f4692c622fedfecab3571c12b37ce6d72a4c0e (patch)
tree7ef454ac96de782a2e69463642b7d51c787ad2d1 /clang/lib/Sema/SemaDecl.cpp
parentc68bf4c036a51c3d1e686b94d2567eb61a766b02 (diff)
downloadbcm5719-llvm-21f4692c622fedfecab3571c12b37ce6d72a4c0e.tar.gz
bcm5719-llvm-21f4692c622fedfecab3571c12b37ce6d72a4c0e.zip
When completing a lambda expression, make sure to check and attach the
body of the lambda to the function call operator. llvm-svn: 150087
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ffc7c618727..ed8d8a5d71b 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7236,7 +7236,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
computeNRVO(Body, getCurFunction());
}
- assert(FD == getCurFunctionDecl() && "Function parsing confused");
+ assert((FD == getCurFunctionDecl() || getCurLambda()->CallOperator == FD) &&
+ "Function parsing confused");
} else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(dcl)) {
assert(MD == getCurMethodDecl() && "Method parsing confused");
MD->setBody(Body);
OpenPOWER on IntegriCloud