Clang-tidy (check misc-include-cleaner) inserts C++ headers into plain C code. For example #include <cinttypes> instead of the expected #include <inttypes.h>.
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 main.c now contains "#include <cinttypes>" as opposed to "#include <inttypes.h>".
Clang-tidy (check `misc-include-cleaner`) inserts C++ headers into plain C code. For example `#include <cinttypes>` instead of the expected `#include <inttypes.h>`.
Steps to reproduce:
```bash
# 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 main.c now contains "#include <cinttypes>" as opposed to "#include <inttypes.h>".
```
Thank you.
[test-includes.tar.gz](https://github.com/user-attachments/files/17544742/test-includes.tar.gz)
Clang-tidy (check
misc-include-cleaner
) inserts C++ headers into plain C code. For example#include <cinttypes>
instead of the expected#include <inttypes.h>
.Steps to reproduce:
Thank you.
test-includes.tar.gz