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

    <tr>
        <th>Summary</th>
        <td>
            Include cleaner prefers <assert.h> over <cassert> for assert() in C++ files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-include-cleaner
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          sam-mccall
      </td>
    </tr>
</table>

<pre>
    TL;DR: assert.h is getting the PreferredHeader signal due to name match.

```
// test.cpp
#include <bits/stdc++.h> // assuming libstdc++
void x() { assert(42); }
```

Clangd correctly produces the diagnostic `No header providing "assert" is directly included`.
The suggested fix is to insert `#include <assert.h>`, but we should prefer `<cassert>`.

`<cassert>` is listed first in StdSymbolMap.inc, so would in general be preferred, but because the symbol name matches the header name the `PreferredHeader` signal kicks in.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU9tu2zgQ_RrqZWBBJmVdHvQQ2zF2gd2iaPIDvIwkNpQokJST_H1BmUbStIBAgZeZOXPOGe69HmbEjhyO5HDO-BpG6zrPp90kJTcmE1a9d8__EXY8_yDsAbj36EI-gvYwYAh6HiCMCN8d9ugcqn-QK3QQ83IDakUIFmY-IUw8yDEnxZkUD2mtivTdtvRC6AUC-pDLZbkfMj1LsyoEwk5CB0_oxQclCT0SesxHwh4hRXLv1ykiMlp8PLnluVqt4I3QhtAWSH1MnRDalJTQlrAjkPr8d1zbejJ8HhRI6xzKYN5hcVatEv3Wv9J8mK0PWgKpim8WxhsPi7NXrSImQum9JI3sKZ3ypPYUqYrEzvOI4NdhQB9QQa_f4vtgQc8xPhb4nZW7KIQ9bncnEGuAVwQ_2tUoWDZxtjh2kgnF9vYPOb7cx8JGJxjOB9AzPAX19D4Ja_7nS65nGet5C69bKT3DgDM6bkBgKuxQ3TEJlHz1uFHmtySfvJGoTMxt53FPquKLuyKwZLAXLV886DnPVMdUy1qeYbevGlbTtm3qbOxoWZct1m0ja75H1au-ESVlTGLJxJ7KTHe0oKw47It9WVa0zoUU_aEQRd_QZt_ylpQFTlyb3JjrlFs3ZNr7FbuKVuyQGS7Q-G2CKJXRJLskzU4a5DM6QmkcLtfF-J1YB0_KIrLqPzIGHQx2_yZNU2Diz3_RGOw1qvlZKuit-3B0tLie4XTzP_TaoM9WZ7oxhMUTliZt0GFcRS7tROglIkm_3eLsT5SB0MvWaJy4rddfAQAA__-3mVNU">