@@ -197,7 +197,6 @@ struct IndirectLocalPathEntry {
197
197
VarInit,
198
198
LValToRVal,
199
199
LifetimeBoundCall,
200
- LifetimeCapture,
201
200
TemporaryCopy,
202
201
LambdaCaptureInit,
203
202
GslReferenceInit,
@@ -1054,7 +1053,6 @@ static SourceRange nextPathEntryRange(const IndirectLocalPath &Path, unsigned I,
1054
1053
case IndirectLocalPathEntry::AddressOf:
1055
1054
case IndirectLocalPathEntry::LValToRVal:
1056
1055
case IndirectLocalPathEntry::LifetimeBoundCall:
1057
- case IndirectLocalPathEntry::LifetimeCapture:
1058
1056
case IndirectLocalPathEntry::TemporaryCopy:
1059
1057
case IndirectLocalPathEntry::GslReferenceInit:
1060
1058
case IndirectLocalPathEntry::GslPointerInit:
@@ -1088,7 +1086,6 @@ static bool pathOnlyHandlesGslPointer(const IndirectLocalPath &Path) {
1088
1086
case IndirectLocalPathEntry::VarInit:
1089
1087
case IndirectLocalPathEntry::AddressOf:
1090
1088
case IndirectLocalPathEntry::LifetimeBoundCall:
1091
- case IndirectLocalPathEntry::LifetimeCapture:
1092
1089
continue ;
1093
1090
case IndirectLocalPathEntry::GslPointerInit:
1094
1091
case IndirectLocalPathEntry::GslReferenceInit:
@@ -1212,9 +1209,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
1212
1209
// and the capturing entity does too, so don't warn.
1213
1210
if (!MTE)
1214
1211
return false ;
1215
- assert (shouldLifetimeExtendThroughPath (Path) ==
1216
- PathLifetimeKind::NoExtend &&
1217
- " No lifetime extension in function calls" );
1218
1212
if (CapEntity->Entity )
1219
1213
SemaRef.Diag (DiagLoc, diag::warn_dangling_reference_captured)
1220
1214
<< CapEntity->Entity << DiagRange;
@@ -1227,9 +1221,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
1227
1221
case LK_Assignment: {
1228
1222
if (!MTE || pathContainsInit (Path))
1229
1223
return false ;
1230
- assert (shouldLifetimeExtendThroughPath (Path) ==
1231
- PathLifetimeKind::NoExtend &&
1232
- " No lifetime extension for assignments" );
1233
1224
if (IsGslPtrValueFromGslTempOwner)
1234
1225
SemaRef.Diag (DiagLoc, diag::warn_dangling_lifetime_pointer_assignment)
1235
1226
<< AEntity->LHS << DiagRange;
@@ -1384,7 +1375,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
1384
1375
break ;
1385
1376
1386
1377
case IndirectLocalPathEntry::LifetimeBoundCall:
1387
- case IndirectLocalPathEntry::LifetimeCapture:
1388
1378
case IndirectLocalPathEntry::TemporaryCopy:
1389
1379
case IndirectLocalPathEntry::GslPointerInit:
1390
1380
case IndirectLocalPathEntry::GslReferenceInit:
@@ -1450,7 +1440,6 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
1450
1440
break ;
1451
1441
}
1452
1442
case LK_LifetimeCapture: {
1453
- Path.push_back ({IndirectLocalPathEntry::LifetimeCapture, Init});
1454
1443
if (isPointerLikeType (Init->getType ()))
1455
1444
Path.push_back ({IndirectLocalPathEntry::GslPointerInit, Init});
1456
1445
break ;
0 commit comments