Skip to content

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

Merged
jansvoboda11 merged 1 commit intostable/20230725from
jan_svoboda/20230725-has-include-fix-2
Nov 7, 2023
Merged

[clang][modules] Avoid modules diagnostics for __has_include()#7760
jansvoboda11 merged 1 commit intostable/20230725from
jan_svoboda/20230725-has-include-fix-2

Conversation

@jansvoboda11
Copy link
Copy Markdown

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
Copy Markdown
Author

@swift-ci please test

@jansvoboda11
Copy link
Copy Markdown
Author

@swift-ci please test Windows platform

@jansvoboda11
Copy link
Copy Markdown
Author

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

@kubamracek
Copy link
Copy Markdown

@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