-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
clang can't compile headers from the MacOSX14 SDK when targeting catalyst #64438
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
The Xcode 14 clang change means that
now won't diag at all when targeting catalyst, even though the enum is marked as unavailable. |
Relevant downstream change: swiftlang#6431 |
Thanks! |
EugeneZelenko
added
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
and removed
new issue
labels
Aug 7, 2023
@llvm/issue-subscribers-clang-frontend |
tru
pushed a commit
that referenced
this issue
Aug 8, 2023
…me from CF_OPTIONS This cherry-picks swiftlang#6431 since without it, macOS 14 SDK headers don't compile when targeting catalyst. Fixes #64438. (cherry picked from commit bb58748)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This builds with Xcode 14's clang, but not with open-source clang:
The diagnostic is correct! NSFileProviderItem.h does:
And NSFileProviderDefines.h does:
This expands to
and it does mark NSFileProviderItemCapabilities as unavailable on macCatalyst.
In the 13.3 SDK, CFAvailability.h did:
But in the 14.0 SDK, it instead does:
That is, previously the enum values were in an unnamed enum with underlying type NSUInteger, but now they're in an unnamed enum with underlying type NSFileProviderItemCapabilities. NSFileProviderItemCapabilities is unavailable and now referenced, so clang warns.
Here's a reduced repro based on that:
Xcode 13.3's clang diags the same way on this repro. But Xcode 14's doesn't:
But if I remove the CF_OPTIONS macro and inline its contents, then xcode 14's clang also diags.
So it must have some "if avail diag is for unnamed enum where both the unavail type and the enum keyword are part of a macros, then don't diag" logic I guess?
The text was updated successfully, but these errors were encountered: