Skip to content

Commit 87fea69

Browse files
committed
address review comment.
1 parent 765d566 commit 87fea69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,12 +1108,12 @@ enum PathLifetimeKind {
11081108
static PathLifetimeKind
11091109
shouldLifetimeExtendThroughPath(const IndirectLocalPath &Path) {
11101110
for (auto Elem : Path) {
1111-
if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
1112-
return PathLifetimeKind::Extend;
1113-
if (Elem.Kind == IndirectLocalPathEntry::MemberExpr)
1111+
if (Elem.Kind == IndirectLocalPathEntry::MemberExpr ||
1112+
Elem.Kind == IndirectLocalPathEntry::LambdaCaptureInit)
11141113
continue;
1115-
if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit)
1116-
return PathLifetimeKind::NoExtend;
1114+
return Elem.Kind == IndirectLocalPathEntry::DefaultInit
1115+
? PathLifetimeKind::Extend
1116+
: PathLifetimeKind::NoExtend;
11171117
}
11181118
return PathLifetimeKind::Extend;
11191119
}

0 commit comments

Comments
 (0)