Skip to content

Commit 67c8b0e

Browse files
committed
[clang][NFC] Remove an unnecessary variable in CheckExprLifetime.cpp
1 parent 7603fea commit 67c8b0e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,16 +1132,15 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
11321132
auto *MTE = dyn_cast<MaterializeTemporaryExpr>(L);
11331133

11341134
bool IsGslPtrValueFromGslTempOwner = false;
1135-
bool IsLocalGslOwner = false;
11361135
if (pathOnlyHandlesGslPointer(Path)) {
11371136
if (isa<DeclRefExpr>(L)) {
11381137
// We do not want to follow the references when returning a pointer
11391138
// originating from a local owner to avoid the following false positive:
11401139
// int &p = *localUniquePtr;
11411140
// someContainer.add(std::move(localUniquePtr));
11421141
// return p;
1143-
IsLocalGslOwner = isRecordWithAttr<OwnerAttr>(L->getType());
1144-
if (pathContainsInit(Path) || !IsLocalGslOwner)
1142+
if (pathContainsInit(Path) ||
1143+
!isRecordWithAttr<OwnerAttr>(L->getType()))
11451144
return false;
11461145
} else {
11471146
IsGslPtrValueFromGslTempOwner =

0 commit comments

Comments
 (0)