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

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 10 12:11:45 PDT 2018


JonasToth added a subscriber: aaron.ballman.
JonasToth added a comment.

>   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.

I think the `operator->` is transitively called, isn't it? (see andrei alexandrescu talk here: https://youtu.be/ozOgzlxIsdg?t=15m55s where he gives a nice class for generic locking)
Maybe there is something more general at work? I think @aaron.ballman knows more about deeper language questions :)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50883





More information about the cfe-commits mailing list