Issue 113926
Summary clang-tidy: misc-include-cleaner: C++ headers are included into C code
Labels clang-tidy
Assignees
Reporter JanMatCodasip
    Clang-tidy (check `misc-include-cleaner`) includes 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 .
[test-includes.tar.gz](https://github.com/user-attachments/files/17544736/test-includes.tar.gz)

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to