diff options
-rw-r--r-- | clang/lib/Sema/CheckExprLifetime.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/CheckExprLifetime.cpp b/clang/lib/Sema/CheckExprLifetime.cpp index 843fdb4..add6d75 100644 --- a/clang/lib/Sema/CheckExprLifetime.cpp +++ b/clang/lib/Sema/CheckExprLifetime.cpp @@ -1091,14 +1091,13 @@ enum PathLifetimeKind { /// supposed to lifetime-extend along. static PathLifetimeKind shouldLifetimeExtendThroughPath(const IndirectLocalPath &Path) { - PathLifetimeKind Kind = PathLifetimeKind::Extend; for (auto Elem : Path) { if (Elem.Kind == IndirectLocalPathEntry::DefaultInit) return PathLifetimeKind::Extend; - else if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit) + if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit) return PathLifetimeKind::NoExtend; } - return Kind; + return PathLifetimeKind::Extend; } /// Find the range for the first interesting entry in the path at or after I. |