aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index e82654ef06..2bd69edb07 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -406,6 +406,13 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc,
CallOperator->setType(FunctionTy);
}
+ // C++ [expr.prim.lambda]p7:
+ // The lambda-expression's compound-statement yields the
+ // function-body (8.4) of the function call operator [...].
+ ActOnFinishFunctionBody(CallOperator, Body, /*IsInstantation=*/false);
+ CallOperator->setLexicalDeclContext(Class);
+ Class->addDecl(CallOperator);
+
// C++11 [expr.prim.lambda]p6:
// The closure type for a lambda-expression with no lambda-capture
// has a public non-virtual non-explicit const conversion function
@@ -450,15 +457,8 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc,
Class->addDecl(Conversion);
}
- // C++ [expr.prim.lambda]p7:
- // The lambda-expression's compound-statement yields the
- // function-body (8.4) of the function call operator [...].
- ActOnFinishFunctionBody(CallOperator, Body, /*IsInstantation=*/false);
-
// Finalize the lambda class.
SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end());
- CallOperator->setLexicalDeclContext(Class);
- Class->addDecl(CallOperator);
ActOnFields(0, Class->getLocation(), Class, Fields,
SourceLocation(), SourceLocation(), 0);
CheckCompletedCXXClass(Class);