diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:23:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:23:03 +0000 |
commit | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (patch) | |
tree | 9ac2087dfbe8507c56dd39d17cad42836448829f /lib/Sema/SemaDeclCXX.cpp | |
parent | 1de93ee5610e8a97e753c881c574f8d994e71373 (diff) |
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f2fb95c39163..aa26b37f444d 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -12265,11 +12265,10 @@ void Sema::DefineImplicitLambdaToFunctionPointerConversion( // Construct the body of the conversion function { return __invoke; }. Expr *FunctionRef = BuildDeclRefExpr(Invoker, Invoker->getType(), VK_LValue, Conv->getLocation()).get(); - assert(FunctionRef && "Can't refer to __invoke function?"); - Stmt *Return = BuildReturnStmt(Conv->getLocation(), FunctionRef).get(); - Conv->setBody(new (Context) CompoundStmt(Context, Return, - Conv->getLocation(), - Conv->getLocation())); + assert(FunctionRef && "Can't refer to __invoke function?"); + Stmt *Return = BuildReturnStmt(Conv->getLocation(), FunctionRef).get(); + Conv->setBody(CompoundStmt::Create(Context, Return, Conv->getLocation(), + Conv->getLocation())); Conv->markUsed(Context); Conv->setReferenced(); @@ -12330,9 +12329,8 @@ void Sema::DefineImplicitLambdaToBlockPointerConversion( // Set the body of the conversion function. Stmt *ReturnS = Return.get(); - Conv->setBody(new (Context) CompoundStmt(Context, ReturnS, - Conv->getLocation(), - Conv->getLocation())); + Conv->setBody(CompoundStmt::Create(Context, ReturnS, Conv->getLocation(), + Conv->getLocation())); Conv->markUsed(Context); // We're done; notify the mutation listener, if any. |