<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/76567>76567</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] misc-include-cleaner incompatible with modernize-deprecated-headers ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Zitrax
      </td>
    </tr>
</table>

<pre>
    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
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE1v4zYQ_TWjy8ACTUaSfdAhtldF0GLbQ0690eRIYpciBZJK4v31hSQncYLdxQKGCYzm4703j5Qxms4R1VAcoDhlckq9D_W_JgX5kp29vtQP2MsnQucTtn5yGqW74LO8YPLYmhdUXhNa840w9Sbis0m9nxLGaRwDxWhct8QQSvb1778evj5CydAHjGYwVoYc2AnY_fW_ZOtPjeM1woVxyk6aEMTR-JgCyQHElw9lvAHe4MOSOA9ckKRguo5CBPExDXHpGI136FvUNAZSMpHGI_AD8AP2JDUFBF7FFIzr8h54BeKAyrto5k_Twgt4pdYM4BUaFxNJjVAcBq8pOPOdNu_dN2vXCMXpR9TeJv0OtddRP6fo_CuLMfgno1e4PKYwL1xa4BxNRG0CqWQveEWyojdRba6BjbIkHYWfoH6l_xG0cQkHaRzwHfA9QnVY4xiTnqGKezVbBMQRxBFvMO34kr_GgXMojm4-xGsDRAyUpuCQvQWhOn1yzy2Wx57wWQY3C9AGP8w-_OV6SoaD_EYRI7lIeJ693PvJage8Skv5rT43ZdJa_3y1RuoJ1zGfXBXXuzJ7_KpdybCnQG8354oWRHPL4w-vz94mpBc5jJZA3GOf0risfll6tybkPnTAm-_Am-Lx5cvTn-Kf8oMeFGerL1dSWem6TTL6gtsqZ3mJ0mnc7nKWs0zXQu_FXmZUbysmdiUTe5b19V4ytaW2bCVjrVRKlYVmu4KkquRW78vM1JxxseV8v70TYstypltV3ElZqLLaq6qFO0aDNDa39mmY8WYmxonqqizKKrPyTDYuDxLn7wgXN5yyUM9Fm_PURbhj1sQU39skk-zylN2UFSf8kZ9nw_thlMmc7So9_soVCKLJpmDrT5qb1E_nXPkBeDPDuB6bMfj_SCXgzUItAm8Wdv8HAAD__7Futfs">