[clang-tools-extra] [clang-tidy] Make `modernize-use-using`'s fix-its more robust (PR #149694)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 23 11:54:15 PDT 2025
localspook wrote:
> give up fixed multiple type in type define when the types are not exactly the same
That would get rid of the bad fix-its, but I think it would lose too many of the good ones. For example, we handle this case perfectly fine:
```cpp
typedef int Int, *IntPtr;
```
> only fix the first typedef?
Unfortunately, the reason that we have wrong fix-its is the same reason that this wouldn't work. For example, given this code:
```cpp
typedef int* IntPtr, &IntRef;
```
to transform it into this:
```cpp
using IntPtr = int*;
typedef int &IntRef;
```
we would need to figure out that the `int` applies to both names, but the `*` applies only to the first one.
https://github.com/llvm/llvm-project/pull/149694
More information about the cfe-commits
mailing list