AST: Skip weak linking on Windows consistently.

Always special-case Windows targets in `isAlwaysWeakImported()` instead of
limiting the special case to declarations that are marked unavailable.
This commit is contained in:
Allan Shortlidge
2025-10-20 12:08:09 -07:00
parent 25af94495c
commit f87aa5323f
2 changed files with 37 additions and 3 deletions

View File

@@ -1525,12 +1525,15 @@ bool Decl::isAlwaysWeakImported() const {
return clangDecl->isWeakImported(
getASTContext().LangOpts.getMinPlatformVersion());
// FIXME: Weak linking on Windows is not yet supported
// https://github.com/apple/swift/issues/53303
if (getASTContext().LangOpts.Target.isOSWindows())
return false;
if (getAttrs().hasAttribute<WeakLinkedAttr>())
return true;
// FIXME: Weak linking on Windows is not yet supported
// https://github.com/apple/swift/issues/53303
if (isUnavailable() && !getASTContext().LangOpts.Target.isOSWindows())
if (isUnavailable())
return true;
if (auto *accessor = dyn_cast<AccessorDecl>(this))