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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] False negative readability-redundant-casting with typedef and using
        </td>
    </tr>

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

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

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

<pre>
    ~~~c++
typedef long LONG;
using ULONG = unsigned long;
void f(long x) {
    LONG y = static_cast<LONG>(x);
}
void g(unsigned long x) {
    ULONG y = static_cast<ULONG>(x);
}
void h(long x) {
    long y = static_cast<long>(x);
}
~~~
~~~
<source>:10:14: warning: redundant explicit casting to the same type 'long' as the sub-expression, remove this casting [readability-redundant-casting]
   10 |     long y = static_cast<long>(x);
      |              ^~~~~~~~~~~~~~~~~~ ~
<source>:9:13: note: source type originates from referencing this parameter]
    9 | void h(long x) {
      |        ~~~~ ^
~~~
There are no warnings for `f()` and `g()`.
https://godbolt.org/z/cxEs3WrdK
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVMGOgzYQ_ZrhMkpkbAhw4JBNQg-t2ktXPVYGBnBFcGSbbNJDvr2yk6W70W5bFUVxNOP33sybMNJa1U9EJaQvkO4jObtBm7IZTDOYVa_cMNdRrdtrebvdGuAv_sP2wLbueqKWOhz11ONPv_z8A4hHZrZq6vHVxxDEHucpaLTh6nLrrFWLHfA8EFyAFwjZI4eIgRKvgcA66VTzeyOtA7G7ax2A5x608EG2_0DcA88_6X6h8PqtxOt_0hi-Lz6Ev2K-W_A98e12e_oBYmf1bBryMLGNmf9KQGzxTZpJebotGmrnqZWTQ7qcRtUoh17Qz8FpdAOhlUdCPzMEnoUqeIbS3nNzvaLLyZC1Sk_Ad2joqM-EblB2IYL0xZBsZa1G5a6rRXL1uADpfjEgZgjZDv-PFQG0oJcH0sPt-cGvLSq8Q8LbMmlH_rxn7-1ro3o1SUcWO6OPaKgjQ1MTvPL9nqSRR3JkPjaERSjp3-b-qfBQIqSHp4H-OpAhlIZw0u8ztNhpg7Bh_oXwbmwYyqn1kX6JrO_4wbmTBbEFXgGvet3WenRrbXrg1Z_Aq-ZysOI30_4YtaVoC1HIiMo4Y1meZEmcRUPZJaJL8i5maZ60vMi6jrOabTpKxKaouzhSJWc8YTwWcc6ESNciK3KeNWnDUhZ3MoaE0VGqcT2O56PXjpS1M5V5vEniaJQ1jTasFM6bUU79yqn2Cpz7FWNKD1rVc28hYaOyzv5N45QbwzL6AEv3WMnREk7US6fOhP_4P8Q35QZ8X0_exbCQotmM5ZN3Yb2tG30EXvkSHsfqZPQf1DjgVWjLAq9CZ38FAAD__9cRkO8">