@@ -2681,9 +2681,25 @@ namespace {
26812681 if (!result)
26822682 return nullptr ;
26832683
2684- if (auto classDecl = dyn_cast<ClassDecl>(result))
2684+ if (auto classDecl = dyn_cast<ClassDecl>(result)) {
26852685 validateForeignReferenceType (decl, classDecl);
26862686
2687+ auto ctx = Impl.SwiftContext .getSwift58Availability ();
2688+ if (!ctx.isAlwaysAvailable ()) {
2689+ assert (ctx.getOSVersion ().hasLowerEndpoint ());
2690+ auto AvAttr = new (Impl.SwiftContext ) AvailableAttr (
2691+ SourceLoc (), SourceRange (),
2692+ targetPlatform (Impl.SwiftContext .LangOpts ), " " , " " ,
2693+ /* RenameDecl=*/ nullptr , ctx.getOSVersion ().getLowerEndpoint (),
2694+ /* IntroducedRange=*/ SourceRange (), {},
2695+ /* DeprecatedRange=*/ SourceRange (), {},
2696+ /* ObsoletedRange=*/ SourceRange (),
2697+ PlatformAgnosticAvailabilityKind::None, /* Implicit=*/ false ,
2698+ false );
2699+ classDecl->getAttrs ().add (AvAttr);
2700+ }
2701+ }
2702+
26872703 // If this module is declared as a C++ module, try to synthesize
26882704 // conformances to Swift protocols from the Cxx module.
26892705 auto clangModule = decl->getOwningModule ();
0 commit comments