[PATCH] D70052: [clang-tidy] Add misc-mutating-copy check
Gabor Bencze via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 18 15:04:45 PST 2019
gbencze added a comment.
In D70052#1749730 <https://reviews.llvm.org/D70052#1749730>, @JonasToth wrote:
> There is a `ExprMutAnalyzer` that is able to find mutation of expressions in general (even though it is kinda experimental still). Maybe that should be utilized somehow? I think the current implementation does not cover when the address is taken and mutation happens through pointers/references in free standing functions, does it?
>
> On the other hand it makes the check more complicated, slower. Additionally the most cases are catched with this version, i guess.
You're right, the current version does not cover mutations through pointers and references. I'm not sure how common these would be, but `ExprMutAnalyzer` seems like a great option if we wanted to add support for those cases as well.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70052/new/
https://reviews.llvm.org/D70052
More information about the cfe-commits
mailing list