[PATCH] D60507: [clang-tidy] new check: bugprone-unhandled-self-assignment

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 14 07:44:39 PDT 2019


xazax.hun added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/bugprone-unhandled-self-assignment.cpp:326
+
+// We should not catch move assignment operators.
+class MoveAssignOperator {
----------------
While I do agree move assignment operators should not be checked by default some would argue that move assignments should still be tolerant to self assignments as one could write something like:
```
x = std::move(aliasToX);
```
Having an option to also check move assignments in a follow-up patch would be also nice to have.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60507





More information about the cfe-commits mailing list