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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] Detect more redundant casts (google-readability-casting)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          chrchr-github
      </td>
    </tr>
</table>

<pre>
    ~~~c++
void f(int* p, int* q, int* r) {
    *static_cast<int*>(p) = 0;
 *const_cast<int*>(q) = 0;
    *(int*)r = 0;
}
~~~
Only the C-style cast is detected:
~~~
<source>:4:6: warning: redundant cast to the same type [google-readability-casting]
    4 |     *(int*)r = 0;
 |      ^~~~~~
~~~
https://godbolt.org/z/YYcxM5Ya6
Related: https://github.com/llvm/llvm-project/issues/24899
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck8GOmzwUhZ_msrESwTUOsGDBhGH365e6m1VlbAOuHJyxzbR0wbNXwCRTRaOqqoTEWXzH9xx84d7rflSqBPYErI74FAbrSjE4MbhDr8MwtVFr5VwuyyIAn9YnriGu3qyWpAPM9RgAK3IFPJN3_fqbdoAFgezdRQghgJUPPGjxVXAfgJ53EugzYH7dcFqTGOjNA1gJO_rwGf_6Cb_PuEcDLNwDAlm9i2VZdvH_aGYSBkXOBx9mo8g6i2hPpApKBCWBVg8WoGdvJyfUmoRWKdDqBLQi37kb9div0ik5jZKPYT8u2G2E5xdFwnxVBNhTb21v1MEpLnmrjQ7zYWXXA1j9USglkJ3JX1S7cwTY87Lc097FEMLVr22wAWx6K1trwtG6HrD5Cdi8vIgf_7EXftrxL8rwvT55cG7LcRT2AtgY83Z7Ha7OflMiADba-0l5wAbTvCgiWVJZ0IJHqkxOBcvjPGU0GspEdixL2hOVMs7inHMumeKosKVCtbyLdIkx0rjALC5YmtBjJ3LRJR2KNskobymksbpwbY5rgLVLtI0uTxmjaWR4q4y_rbgrt5Tt1HtIY6N98B-2oIPZfgZh-NgfgpYzsJrU2xKQi3Xq4U49Acz_cIdYRJMz5b9_uq3CrwAAAP__c1MYZg">