aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ExprCXX.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 29ff69d312..1f8a57a4e3 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -781,13 +781,10 @@ LambdaExpr *LambdaExpr::Create(ASTContext &Context,
// Determine the type of the expression (i.e., the type of the
// function object we're creating).
QualType T = Context.getTypeDeclType(Class);
- size_t Size = sizeof(LambdaExpr) + sizeof(Capture) * Captures.size()
- + sizeof(Stmt *) * (Captures.size() + 1);
- void *Mem = Context.Allocate(Size, llvm::alignOf<LambdaExpr>());
- return new (Mem) LambdaExpr(T, IntroducerRange, CaptureDefault,
- Captures, ExplicitParams, CaptureInits,
- ClosingBrace);
+ return new (Context) LambdaExpr(T, IntroducerRange, CaptureDefault,
+ Captures, ExplicitParams, CaptureInits,
+ ClosingBrace);
}
LambdaExpr::capture_iterator LambdaExpr::capture_begin() const {