Skip to content

[clang][modules] Avoid modules diagnostics for __has_include() #7760

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

Conversation

jansvoboda11
Copy link

After llvm#70144 Clang started resolving module maps even for __has_include() expressions. This had the unintended consequence of emitting diagnostics around header misuse. These don't make sense if you actually don't bring contents of the header into the importer, so should be skipped for __has_include(). This patch moves emission of these diagnostics out of Preprocessor::LookupFile() up into Preprocessor::LookupHeaderIncludeOrImport().

(cherry picked from commit bdb309c)

…m#71450)

After llvm#70144 Clang started resolving module maps even for
`__has_include()` expressions. This had the unintended consequence of
emitting diagnostics around header misuse. These don't make sense if you
actually don't bring contents of the header into the importer, so should
be skipped for `__has_include()`. This patch moves emission of these
diagnostics out of `Preprocessor::LookupFile()` up into
`Preprocessor::LookupHeaderIncludeOrImport()`.

(cherry picked from commit bdb309c)
@jansvoboda11
Copy link
Author

@swift-ci please test

@jansvoboda11
Copy link
Author

@swift-ci please test Windows platform

@jansvoboda11
Copy link
Author

Merging is blocked due to Windows failure tracked here: swiftlang/swift#69687

@kubamracek
Copy link

@swift-ci please test Windows platform

@jansvoboda11 jansvoboda11 merged commit cd01bae into stable/20230725 Nov 7, 2023
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/20230725-has-include-fix-2 branch November 7, 2023 22:59
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.

2 participants