[PATCH] D52315: [clang-tidy] Fix for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 00:51:03 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D52315#1241487, @baloghadamsoftware wrote:

> I still wonder what true positives could we get without checking the size? No real-life types come to my mind with size of a pointer but really expensive copy operations. What could be so really expensive when copying a single machine world?


The type is not trivially-copyable, so how do you know the user-provided copy constructors
don't treat that pointer as a pointer to a string, which they allocate and copy on each copy?

I really don't think the default should change.
I think the best solution would be simply to add type blacklists for each of these checks.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52315





More information about the cfe-commits mailing list