================
@@ -205,8 +208,7 @@ void UseUsingCheck::check(const MatchFinder::MatchResult
&Result) {
}
if (!ReplaceRange.getEnd().isMacroID()) {
- const SourceLocation::IntTy Offset =
- MatchedDecl->getFunctionType() ? 0 : Name.size();
+ const SourceLocation::IntTy Offset = FunctionPointerCase ? 0 : Name.size();
----------------
flovent wrote:
Using `getLocForEndOfToken` will use get the loc of `,` as the beginning of
replace for second typedef in this case comparing to the old way, which makes
two fixs' ranges will not overlap and being able to provide a fix, although
it's wrong.
It seems not very trivial make multi function pointer case work, because their
type is mixed up together.
For single typedef:
```
typedef char (&refArray)[2];
```
We actually put `char (&`(type loc begin to name begin) and `)[2]`(name end to
type loc end) together to get its type string.
But when there are multi alias types, their share the same type begin, that's
why `ptrArray` will get `char (&refArray)[2], (*` for the first part.
https://github.com/llvm/llvm-project/pull/173751
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits