<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95716>95716</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy: modernize-use-using expands macro
</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
#ifdef FOO
#define REAL float
#else
#define REAL double
#endif
typedef REAL 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" } ]
```
```console
$ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 17.0.6
Optimized build.
$ clang-tidy --fix --checks=modernize-use-using a.cpp
1 warning generated.
a.cpp:7:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
7 | typedef REAL foo;
| ^~~~~~~~~~~~~~~~
| using foo = double
a.cpp:7:1: note: FIX-IT applied suggested code changes
clang-tidy applied 1 of 1 suggested fixes.
```
gives
```cpp
using foo = double;
```
which must be
```cpp
using foo = REAL;
```
<https://godbolt.org/z/s17GT95EW>
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVF2PqzYQ_TXDywgEdoDkgYdks6mutNVW1VXbt8rYA_G9gBE2-_XQ314ZyMdudyMVhYBnzhzPHGYsrNV1R1RAuoN0H4jRHc1QUPjz2bZBadRr8dtAvRgIIYuBHVzbAzuISPa9N_AtxHuIT_9ZPP-8d7YwritFFR4eH88WRZXuCH-_3z5g1Rjhzh5qLH0KU2Ysm4uLOqWr653da09-m5nTGOC7Dyldo0Wn3pUjTdvrhv6Wpm1Fp2z0w5ruRnmTezalO4R8h8CY0gNJZ4ZXYAz41ptOGzBgd3698F8AshFdDWwHbIehdQr4Xs7LJMFQYmhQRP72gp5pKt3QheOD04yuH9212wBjCPkeId3fEOXy8UxnzUXsFU5Zhk6rVwzDJxqsPpX_8PDHrwhsfXSu92KxA7BD0zy1kRnqabU5a4g4oZd4TPIojrLF9dg73eo3UliOulHRF3tX-gXDUB5J_rTA961RNHT6jcLR-lt39SwVzvEJPouh89aaOhqEoxPzrBnf5sC3iRdqAfrX0RICyyc6YDnqzjoSCk3lzUujeQeku08yOIuMiJgj5Hf4ZXPidHkIpPf_vL8-IubyKmMQ-P7dPPynmM448s_Dt7_Cb99R9H2jSaEd65qsI4XSKEJ5FF1Ndua4kvkET3zFyVVUpV_IRjc6qNZPJ76vzoNPq7g5q89HLY_YjtZhSf-H3Kt9mxr4nW9ce-7c2qjSNG5p3jdgB5vkv3zfpPd_Ar8PVMHVhm9EQEWSJ-s0YxnbBMci58kqr8q0SjK5FsSEilOerHgZp2UmKQl0wWK2irMkS9Y8ZptopXIhs1Ru8rUkIgGrmFqhm-g0O4G2dqRik-ZJFjSipMZOR_RyZExfys94ug-GwgeF5VhbWMWNts5eaJx2DRVXMXyLn40NvfT-4MNWyMEE49AUH5TR7jiWkTTtMuDLI-wH84OkA3aYMrbADnPSTwX7NwAA__91X9NZ">