Skip to content

Commit 00aa22f

Browse files
authored
Merge pull request #82218 from xedin/rdar-152687353-move-check-higher
[Concurrency] NonisolatedNonsendingByDefault/NFC: Move 'same module' …
2 parents 0311223 + f0502c2 commit 00aa22f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Sema/NonisolatedNonsendingByDefaultMigration.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ void NonisolatedNonsendingByDefaultMigrationTarget::diagnose() const {
7373
return;
7474
}
7575

76+
// Only diagnose declarations from the current module.
77+
if (decl->getModuleContext() != ctx.MainModule) {
78+
return;
79+
}
80+
7681
// If the attribute cannot appear on this kind of declaration, we can't
7782
// diagnose it.
7883
if (!DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind::Concurrent,
@@ -153,10 +158,6 @@ void NonisolatedNonsendingByDefaultMigrationTarget::diagnose() const {
153158

154159
const auto featureName = feature.getName();
155160
if (decl) {
156-
// Only diagnose declarations from the current module.
157-
if (decl->getModuleContext() != ctx.MainModule)
158-
return;
159-
160161
// Diagnose the function, but slap the attribute on the storage declaration
161162
// instead if the function is an accessor.
162163
auto *functionDecl = dyn_cast<AbstractFunctionDecl>(decl);

0 commit comments

Comments
 (0)