Skip to content

Move diagnostic about @_weakLinked not working for COFF into the type checker #72015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

DougGregor
Copy link
Member

This allows us to use @_weakLinked inside of a #if properly.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge March 1, 2024 18:32
@DougGregor DougGregor requested a review from compnerd March 1, 2024 18:32
@slavapestov
Copy link
Contributor

One less annoying thing for ASTGen to deal with!

@DougGregor DougGregor force-pushed the attr-weaklinked-coff-ifdef branch from 3d8001f to 521deca Compare March 1, 2024 20:17
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

…pe checker

This allows us to use `@_weakLinked` inside of a `#if` properly.
@DougGregor DougGregor force-pushed the attr-weaklinked-coff-ifdef branch from 521deca to ed6b713 Compare March 1, 2024 20:19
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

Comment on lines 7346 to 7349
if (Ctx.LangOpts.Target.isOSBinFormatCOFF()) {
diagnoseAndRemoveAttr(attr, diag::attr_unsupported_on_target,
attr->getAttrName(), Ctx.LangOpts.Target.str());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (Ctx.LangOpts.Target.isOSBinFormatCOFF()) {
diagnoseAndRemoveAttr(attr, diag::attr_unsupported_on_target,
attr->getAttrName(), Ctx.LangOpts.Target.str());
}
if (!Ctx.LangOpts.Target.isOSBinFormatCOFF())
return;
diagnoseAndRemoveAttr(attr, diag::attr_unsupported_on_target,
attr->getAttrName(), Ctx.LangOpts.Target.str());

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit 6fbc06e into swiftlang:main Mar 2, 2024
@DougGregor DougGregor deleted the attr-weaklinked-coff-ifdef branch March 11, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants