[PATCH] D70052: [clang-tidy] Add misc-mutating-copy check

Matthias Gehre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 10 10:59:19 PST 2019


mgehre added a comment.

Did you consider to warn on copy constructors/assignment operators take a their arguments by non-`const` reference, and suggest the user to turn them into const references? This seems like a more useful (and easier) check to me.
The link above contains `Ideally, the copy operator should have an idiomatic signature. For copy constructors, that is T(const T&); and for copy assignment operators, that is T& operator=(const T&);.`.

The only remaining case are then `mutable` members which are quite rare.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70052/new/

https://reviews.llvm.org/D70052





More information about the cfe-commits mailing list