<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65055>65055</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy: `modernize-use-using` wrongly modifies typedef of function pointer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
e-kwsm
</td>
</tr>
</table>
<pre>
```shellsession
$ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 15.0.7
Optimized build.
Default target: x86_64-pc-linux-gnu
Host CPU: skylake
```
Prepare the following file, `/tmp/a.cpp`:
```cpp
typedef void (*v0123456789)(int);
typedef bool (*b)(int);
```
and `/tmp/compile_commands.json`:
```json
[
{
"directory": "/tmp",
"command": "/usr/bin/clang++ -o a.o -c a.cpp",
"file": "a.cpp",
"output": "a.o"
}
]
```
Then run `clang-tidy`:
```shellsession
$ clang-tidy --checks='-*,modernize-use-using' --fix a.cpp
2 warnings generated.
/tmp/a.cpp:1:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
typedef void (*v0123456789)(int);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using v0123456789 = void (*)(int)
/tmp/a.cpp:1:1: note: FIX-IT applied suggested code changes
/tmp/a.cpp:2:9: warning: use 'using' instead of 'typedef' [modernize-use-using]
typedef bool (*b)(int);
^~~~~~~~~~~~~~
/tmp/a.cpp:2:9: note: FIX-IT applied suggested code changes
clang-tidy applied 2 of 2 suggested fixes.
```
Here, the message for the second line must be
```shellsession
typedef bool (*b)(int);
^~~~~~~~~~~~~~~~~~~~~~
using b = bool (*)(int)
```
The file is wrongly modified:
```cpp
using v0123456789 = void (*)(int);
typedef ;
using b = bool (*)(int);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vk2PozgQ_TXmUgIR85Fw4JB0NpqRZrVzmF3tbWRwQTxtbGSbTmcO-9tXJ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