@@ -4320,15 +4320,19 @@ void AttributeChecker::checkBackDeployedAttrs(
43204320 // Unavailable decls cannot be back deployed.
43214321 if (auto unavailableAttrPair = VD->getSemanticUnavailableAttr ()) {
43224322 auto unavailableAttr = unavailableAttrPair.value ().first ;
4323- DeclName name;
4324- unsigned accessorKind;
4325- std::tie (accessorKind, name) = getAccessorKindAndNameForDiagnostics (VD);
4326- diagnose (AtLoc, diag::attr_has_no_effect_on_unavailable_decl, Attr,
4327- accessorKind, name, prettyPlatformString (Platform));
4328- diagnose (unavailableAttr->AtLoc , diag::availability_marked_unavailable,
4329- accessorKind, name)
4330- .highlight (unavailableAttr->getRange ());
4331- continue ;
4323+
4324+ if (unavailableAttr->Platform == PlatformKind::none ||
4325+ unavailableAttr->Platform == Attr->Platform ) {
4326+ DeclName name;
4327+ unsigned accessorKind;
4328+ std::tie (accessorKind, name) = getAccessorKindAndNameForDiagnostics (VD);
4329+ diagnose (AtLoc, diag::attr_has_no_effect_on_unavailable_decl, Attr,
4330+ accessorKind, name, prettyPlatformString (Platform));
4331+ diagnose (unavailableAttr->AtLoc , diag::availability_marked_unavailable,
4332+ accessorKind, name)
4333+ .highlight (unavailableAttr->getRange ());
4334+ continue ;
4335+ }
43324336 }
43334337
43344338 // Verify that the decl is available before the back deployment boundary.
0 commit comments