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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] identifier scope for `misc-confusable-identifiers`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    See https://godbolt.org/z/87r1nGjes
```cpp
struct Test {   
        void f1(const char *pl);
};

auto f2(const char *p1, const char *p2) {
        return p1 < p2;
}
```

produces following warnings for identifiers used in the two unrelated functions.
```
[<source>:2:22: warning: pl is confusable with p1 [misc-confusable-identifiers]]
        void f1(const char *pl);
                            ^
[<source>:5:21: note: other declaration found here]
auto f2(const char *p1, const char *p2) {
                    ^
1 warning generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylU9ty2yAQ_Rr0smOPBJZtPeghzqUf0P4AgpVMhoCGSzzJ13eRncZN20xmyiAuu7Dn7B4xeP3Sf0eEY0pzZOKG8Qfqk9eDt2ntw0S7V_r2u9C4b48YWX3H6hu2rc9dzfPZElPIKsEPjAnY7sDq7nKy7p690TA2jO-Vd-RWRxmA8ZvZMt4xcbgc3N29r5dR5uRh5H_eo1C38MFGx7oz8AU1YMrBwdwAE7dA_mug35O4Bp2D11lhhNFb60_GTXCSwdFcTAGMRpfMaDBEyBE1GAfpiJBOHrILaGUi45idSoYYrv8O1R6IVPQ5KGTinurOy1eGN7SynC2YWBIdc5SDRTiZdFwyag9PJqrVu2t1xYu1d6UvSHBpX9MAPmmsvf8X-baQbwpj5xOW2VNJAmhUVgZZCkG1y04DWfEXt__Q91OCzVsNYUKHoQjyUYZK90J3opNVMsliTzkRVTetktEvRPBKZojKz7hoTxc_KzuFzcH2H54SSZaHtfJPtLH2-W1a0Y_2iCrR1sSY6WHxh3bLeVMd-1a1gx6lxEZv-GZApVuNjdg1-0Z0XPPKygFtLKwZ5w5PsISgNVGvTM9rzust39aNEKJdSzGOohWyrgWqcdizTY1P0th14VHeeBX6hdKQp0hOa2KK704Zo5kcLkUq8Um2ow_9ax6zNblaoPuF-k91YEZK">