Skip to content

Commit dc8cdcb

Browse files
authored
Merge pull request #60647 from etcwilde/ewilde/explicit-closure-captures
[Windows]: explicitly set closure captures
2 parents caf5972 + 2373421 commit dc8cdcb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/Sema/CodeSynthesis.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -847,15 +847,16 @@ bool AreAllStoredPropertiesDefaultInitableRequest::evaluate(
847847
for (auto idx : range(pbd->getNumPatternEntries())) {
848848
bool HasStorage = false;
849849
bool CheckDefaultInitializer = true;
850-
pbd->getPattern(idx)->forEachVariable([&](VarDecl *VD) {
851-
// If one of the bound variables is @NSManaged, go ahead no matter
852-
// what.
853-
if (VD->getAttrs().hasAttribute<NSManagedAttr>())
854-
CheckDefaultInitializer = false;
855-
856-
if (VD->hasStorageOrWrapsStorage())
857-
HasStorage = true;
858-
});
850+
pbd->getPattern(idx)->forEachVariable(
851+
[&HasStorage, &CheckDefaultInitializer](VarDecl *VD) {
852+
// If one of the bound variables is @NSManaged, go ahead no matter
853+
// what.
854+
if (VD->getAttrs().hasAttribute<NSManagedAttr>())
855+
CheckDefaultInitializer = false;
856+
857+
if (VD->hasStorageOrWrapsStorage())
858+
HasStorage = true;
859+
});
859860

860861
if (!HasStorage) continue;
861862

0 commit comments

Comments
 (0)