From 3c43b80122fc629f0d3bc4b723dbab8a66c9857b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 19 Oct 2018 19:01:34 +0000 Subject: PR24164, PR39336: init-captures are not distinct full-expressions. Rather, they are subexpressions of the enclosing lambda-expression, and any temporaries in them are destroyed at the end of that full-expression, or when the corresponding lambda-expression is destroyed if they are lifetime-extended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344801 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaLambda.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/Sema/SemaLambda.cpp') diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 8000cb4fbf..803b253e45 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -773,16 +773,6 @@ QualType Sema::buildLambdaInitCaptureInitialization(SourceLocation Loc, InitializationSequence InitSeq(*this, Entity, Kind, Args); ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT); - if (Result.isInvalid()) - return QualType(); - Init = Result.getAs(); - - // The init-capture initialization is a full-expression that must be - // processed as one before we enter the declcontext of the lambda's - // call-operator. - Result = ActOnFinishFullExpr(Init, Loc, /*DiscardedValue*/ false, - /*IsConstexpr*/ false, - /*IsLambdaInitCaptureInitializer*/ true); if (Result.isInvalid()) return QualType(); -- cgit v1.2.1