flx added a comment.

In https://reviews.llvm.org/D52360#1246472, @baloghadamsoftware wrote:

> In https://reviews.llvm.org/D52360#1246443, @danilaml wrote:
>
> > Would that also skip checks for something like `shared_ptr`?
>
>
> Yes, everything ending on `pointer`, `ptr`, `reference` or `ref`, first 
> letter case insensitive.


std::shared_ptr should not be blacklisted. It is not free to copy it: It incurs 
two atomic operations and two branches.

Users should blacklist it if they know they don't care about this or not use 
the check.

While it looks weird for the check to suggest to pass std::shared_ptr by 
reference it is correct. A better change would be to just pass the raw pointer 
in this case:

std::shared_ptr<Ptr> p;
PassByRawPointer(p.get());

But this would require function signature change that breaks callers outside of 
the translation unit.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52360



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to