Skip to content

Conversation

@hzeller
Copy link

@hzeller hzeller commented Oct 24, 2025

If a project is using the facade-header yaml-cpp/yaml.h it might get misc-include-cleaner warnings from the clangd language server and clang-tidy that this header is not providing directly the symbols used.

The annotation with IWYU pragmas fixes that and tells the tools that it should consider all the includes as if they directly provided the symbol

Documentation clangd and clang-tidy
https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html points to https://clangd.llvm.org/design/include-cleaner#iwyu-pragmas

This has been first implemented and docuemnted in the include-what-you-use project https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports

If a project is using the facade-header yaml-cpp/yaml.h it might
get `misc-include-cleaner` warnings from the `clangd` language server
and `clang-tidy` that this header is not providing directly the symbols used.

The annotation with IWYU pragmas fixes that and tells the tools that it should consider
all the includes as if they directly provided the symbol

Documentation clangd and clang-tidy
https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html points to
https://clangd.llvm.org/design/include-cleaner#iwyu-pragmas

This has been first implemented and docuemnted in the include-what-you-use project
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports

Signed-off-by: Henner Zeller <[email protected]>
hzeller added a commit to hzeller/OpenROAD that referenced this pull request Oct 24, 2025
This will trigger a new `misc-include-cleaner` warning
as the yaml-header does not have IWYU annotations. So
we should ignore such clang-tidy warning for now.

I am upstreaming a fix in
jbeder/yaml-cpp#1378

Signed-off-by: Henner Zeller <[email protected]>
hzeller added a commit to hzeller/OpenROAD that referenced this pull request Oct 24, 2025
This will trigger a new `misc-include-cleaner` warning
as the yaml-header does not have IWYU annotations. So
we should ignore such clang-tidy warning for now.

I am upstreaming the necessary IWYU pragmas in
jbeder/yaml-cpp#1378

Signed-off-by: Henner Zeller <[email protected]>
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.

1 participant