Skip to content

Commit 7c28943

Browse files
committed
remove IndirectLocalPathEntry for capture by
1 parent 6039d2f commit 7c28943

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ struct IndirectLocalPathEntry {
197197
VarInit,
198198
LValToRVal,
199199
LifetimeBoundCall,
200-
LifetimeCapture,
201200
TemporaryCopy,
202201
LambdaCaptureInit,
203202
GslReferenceInit,
@@ -1054,7 +1053,6 @@ static SourceRange nextPathEntryRange(const IndirectLocalPath &Path, unsigned I,
10541053
case IndirectLocalPathEntry::AddressOf:
10551054
case IndirectLocalPathEntry::LValToRVal:
10561055
case IndirectLocalPathEntry::LifetimeBoundCall:
1057-
case IndirectLocalPathEntry::LifetimeCapture:
10581056
case IndirectLocalPathEntry::TemporaryCopy:
10591057
case IndirectLocalPathEntry::GslReferenceInit:
10601058
case IndirectLocalPathEntry::GslPointerInit:
@@ -1088,7 +1086,6 @@ static bool pathOnlyHandlesGslPointer(const IndirectLocalPath &Path) {
10881086
case IndirectLocalPathEntry::VarInit:
10891087
case IndirectLocalPathEntry::AddressOf:
10901088
case IndirectLocalPathEntry::LifetimeBoundCall:
1091-
case IndirectLocalPathEntry::LifetimeCapture:
10921089
continue;
10931090
case IndirectLocalPathEntry::GslPointerInit:
10941091
case IndirectLocalPathEntry::GslReferenceInit:
@@ -1212,9 +1209,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
12121209
// and the capturing entity does too, so don't warn.
12131210
if (!MTE)
12141211
return false;
1215-
assert(shouldLifetimeExtendThroughPath(Path) ==
1216-
PathLifetimeKind::NoExtend &&
1217-
"No lifetime extension in function calls");
12181212
if (CapEntity->Entity)
12191213
SemaRef.Diag(DiagLoc, diag::warn_dangling_reference_captured)
12201214
<< CapEntity->Entity << DiagRange;
@@ -1227,9 +1221,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
12271221
case LK_Assignment: {
12281222
if (!MTE || pathContainsInit(Path))
12291223
return false;
1230-
assert(shouldLifetimeExtendThroughPath(Path) ==
1231-
PathLifetimeKind::NoExtend &&
1232-
"No lifetime extension for assignments");
12331224
if (IsGslPtrValueFromGslTempOwner)
12341225
SemaRef.Diag(DiagLoc, diag::warn_dangling_lifetime_pointer_assignment)
12351226
<< AEntity->LHS << DiagRange;
@@ -1384,7 +1375,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
13841375
break;
13851376

13861377
case IndirectLocalPathEntry::LifetimeBoundCall:
1387-
case IndirectLocalPathEntry::LifetimeCapture:
13881378
case IndirectLocalPathEntry::TemporaryCopy:
13891379
case IndirectLocalPathEntry::GslPointerInit:
13901380
case IndirectLocalPathEntry::GslReferenceInit:
@@ -1450,7 +1440,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
14501440
break;
14511441
}
14521442
case LK_LifetimeCapture: {
1453-
Path.push_back({IndirectLocalPathEntry::LifetimeCapture, Init});
14541443
if (isPointerLikeType(Init->getType()))
14551444
Path.push_back({IndirectLocalPathEntry::GslPointerInit, Init});
14561445
break;

0 commit comments

Comments
 (0)