[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 18 04:29:55 PDT 2018


JonasToth added a comment.

I see, thank you :)

Am 17.08.2018 um 18:55 schrieb Shuai Wang via Phabricator:

> shuaiwang added a comment.
> 
> In https://reviews.llvm.org/D50883#1203690, @JonasToth wrote:
> 
>> I am suprised that this does not automatically follow from the general rules. At the end, smartpointers cant do anything else then 'normal' classes.
>> 
>> The `operator+/->` were not handled before? The mutation of `SmartPtr x; x->mf();` should already be catched, not?
> 
> Different from `std::vector::operator[]` which has two overloads for const and non-const access, `std::unique_ptr` only has one const version of `operator->`.
>  So for `SmartPtr x; x->mf();` we only see a const operator being invoked on `x`. `mf` is not a member of `SmartPtr` and the member call to `mf` is not on `x` directly, we never followed that far.
> 
> Repository:
> 
>   rCTE Clang Tools Extra
> 
> https://reviews.llvm.org/D50883


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50883





More information about the cfe-commits mailing list