Issue |
76567
|
Summary |
[clang-tidy] misc-include-cleaner incompatible with modernize-deprecated-headers ?
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
Zitrax
|
I have not found any way to fix code like this without suppressing with `NOLINT` or similar.
```cpp
#include <iostream>
// Including this triggers:
// inclusion of deprecated C++ header 'string.h'; consider using 'cstring' instead [modernize-deprecated-headers]
#include <string.h>
// Including this instead triggers:
// no header providing "strsignal" is directly included [misc-include-cleaner]
#include <cstring>
int main() {
std::cout << strsignal(2) << "\n";
return 0;
}
```
The warning from `modernize-deprecated-headers` makes sense but shouldn't `misc-include-headers` allow using the modern C++ headers like `cstring` here without warning?
Godbolt example: https://godbolt.org/z/5TxEvK3P6
Tested with clang-tidy 17.0.6 and 18.0.0
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs