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

    <tr>
        <th>Summary</th>
        <td>
            regression? clang-tidy modernize-use-using does not work for typedef in a function
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          e-kwsm
      </td>
    </tr>
</table>

<pre>
    Prepare `/tmp/a.cpp`
```cpp
void f() {
  typedef int foo;
}
```
and `/tmp/compile_commands.json`
```json
[ { "directory": "/tmp", "command": "clang++ -std=c++11 -c -o a.o a.cpp", "file": "a.cpp", "output": "a.o" } ]
```

clang-tidy version 14.0.6 on Debian Bookworm points out the `typedef` as expected:
```console
$ clang-tidy --checks='-*,modernize-use-using' a.cpp
1 warning generated.
/tmp/a.cpp:2:3: warning: use 'using' instead of 'typedef' [modernize-use-using]
  typedef int foo;
  ^~~~~~~~~~~~~~~
  using foo = int
```
while 16.0.6 on EndeavourOS does not; the latter works for `typedef`s in other scopes&mdash;global, in a namespace, and in a struct.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VM2SszYQfJrhMgUFEj_LgYP9-fM1qcoDpGQ0gL4FDSWJdTaHPHtK2N6_bFzGRi3Umuluobw3oyXqoDpCdUrUFiZ2HaXPV78kF9av3e-OVuUIoc5BnMOygjirrF_XCOQnyA_xZv9GcEde2GgcQDyBaBGa4w1FDK8raRrQ2IADM8j7DDSnL1S3obL60749L6uZ6c-el0VZ7bNfnu1_69jRG1Qd4_4IQmjjqA_sXkEIkIcIPXgFiB9xfKd9f6CflR1BHEEcMfVBgzz1t2FRYNpjyqiyeMXO32gGM9M7x5dJ3sK6hY_TDEIgNCeE6nsVbr97LWkw-hVfyHnDFosyy7Ma2eKJLkZZPDI_X9ktuLKxwSNvAcO0e3eXHuoclUf6a6U-kAZ5-OohW88z3VFR4od907SfqH_2IE8gmhTEAcSPhTU5a_6mdPPxMlGx5q7JzlLgVTlr7IgjWXIqkM4e_J8CJQ9RFRmVua-It5snBNG8MRvrAymNPET40ZdoEKrjd8U8VP3_-CFC9fOfT5_HxE4RH0aQp7jwW4euk5kJi_phx0-rSb3w5n77AzWTR8sB5HH3YlYhkMMru2ePA7vP5ng0FjlM5ND3vJIHUS9a-QnkcZz5ouaYI2NRoVUL-VX1FJF4UnbUB7f1IUt0J3UrW5VQV9Rt2wpR52UydQ3l9aVpe0FDqRXJph6aqqG6rEo9lBedmE7kQhZFUeZ5KYXMRNte5FOZq7Kshqf6CcqcFmXmbJ5flozdmBjvN-oaUTRtMqsLzX5_n9zPz56dGPjqlLguLkov2-ihzGfjg3-nCSbM1DkaHfmYb5Dnj-n7xts3cXc5dzXfPUaFw2b7YNgmm5u7KYTVx8CLM4jzaMK0XbKeFxDnWML9L10d_6I-gDjvbXkQ572zfwMAAP__RtmPUQ">