We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2cd6ea commit 6e63ad3Copy full SHA for 6e63ad3
clang/lib/Sema/CheckExprLifetime.cpp
@@ -1092,12 +1092,12 @@ enum PathLifetimeKind {
1092
static PathLifetimeKind
1093
shouldLifetimeExtendThroughPath(const IndirectLocalPath &Path) {
1094
for (auto Elem : Path) {
1095
- if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
1096
- return PathLifetimeKind::Extend;
1097
- if (Elem.Kind == IndirectLocalPathEntry::MemberExpr)
+ if (Elem.Kind == IndirectLocalPathEntry::MemberExpr ||
+ Elem.Kind == IndirectLocalPathEntry::LambdaCaptureInit)
1098
continue;
1099
- if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit)
1100
- return PathLifetimeKind::NoExtend;
+ return Elem.Kind == IndirectLocalPathEntry::DefaultInit
+ ? PathLifetimeKind::Extend
+ : PathLifetimeKind::NoExtend;
1101
}
1102
return PathLifetimeKind::Extend;
1103
0 commit comments