Skip to content
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

include-cleaner: ParsedAST::getPragmaIncludes() only contains information for preamble. #1571

Closed
hokein opened this issue Apr 3, 2023 · 0 comments · Fixed by llvm/llvm-project#75612

Comments

@hokein
Copy link
Contributor

hokein commented Apr 3, 2023

The PragmaInclude structure in clangd only contains the information for the preamble, this means the non-preamble IWYU pragmas are not respected in clangd, see the following example:

int abc;
// we still get an unused-include diagnostic.
#include "unused.h" // IWYU pragma: keep

One solution is to build a PragmaInclude when building the main AST and merge it with the one for preamble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant