[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 11 02:22:47 PDT 2018


JonasToth added a comment.

In https://reviews.llvm.org/D50953#1230003, @shuaiwang wrote:

> In https://reviews.llvm.org/D50953#1229287, @JonasToth wrote:
>
> > What happens to pointers in a typedef (in the sense of `*` instead of `&`)?
>
>
> I checked around and I believe reference type is the only type we're explicitly matching right now. We'll need to handle carefully when handling pointer types in the future.


We match on pointers as values. So figure this out `int * >const< ptr = nullptr`.
And the constness transformation is especially intersting for pointer typedefs, because in `typedef int * IntPtr; const IntPtr p1; IntPtr const p2;` p1 and p2 are  different things. It would be nice if you could check, that the value semantic of the pointer is detected through the typedef as well.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50953





More information about the cfe-commits mailing list