From b3d203ff7f308cc5675f095654d0cda905bf95bf 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. llvm-svn: 344801 --- clang/lib/Sema/SemaLambda.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'clang/lib/Sema/SemaLambda.cpp') diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 8000cb4fbfd..803b253e458 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/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.3