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

clang-tidy: misc-include-cleaner: Unused includes not removed from .h file #113927

Open
JanMatCodasip opened this issue Oct 28, 2024 · 1 comment

Comments

@JanMatCodasip
Copy link

JanMatCodasip commented Oct 28, 2024

In the attached example, unused includes #include <stdio.h> and #include <inttypes.h> are not removed from number_generator.h.

These are the steps to reproduce:

# Extract the attached archive
tar xvf test-includes.tar.gz
cd test-includes

# Build the example program (compilation database is also created in the process)
mkdir build && cd build
cmake ..
cmake --build .

run-clang-tidy-18.py -header-filter='-*' -checks='-*,misc-include-cleaner' -fix

# Observe that number_generator.h still contains `#include <stdio.h>` and `#include <inttypes.h>`, despite being unused.

(Note that the attached example as well as the steps to reproduce are identical to issue #113926.)

Thank you.

test-includes.tar.gz

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 28, 2024

@llvm/issue-subscribers-clang-include-cleaner

Author: Jan Matyas (JanMatCodasip)

In the attached example, unused includes `#include <stdio.h>` and `#include <inttypes.h>` are not removed from `number_generator.h`.

These are the steps to reproduce:

# Extract the attached archive
tar xvf test-includes.tar.gz
cd test-includes

# Build the example program (compilation database is also created in the process)
mkdir build &amp;&amp; cd build
cmake ..
cmake --build .

run-clang-tidy-18.py -header-filter='-*' -checks='-*,misc-include-cleaner' -fix

# Observe that number_generator.h still contains `#include &lt;stdio.h&gt;` and `#include &lt;inttypes.h&gt;`, despite being unused.

(Note that the attached example as well as the steps to reproduce are identical to issue #113926.)

Thank you.

test-includes.tar.gz

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

No branches or pull requests

3 participants