[PATCH] D16376: clang-tidy check: User-defined copy without assignment

Jonathan B Coe via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 10:15:24 PST 2016


jbcoe marked 5 inline comments as done.

================
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.h:25
@@ +24,3 @@
+/// assignment operator to be `= delete`.
+///
+/// For the user-facing documentation see:
----------------
The standard says that compiler generation of the assignment operator is deprecated if there is a user-defined copy constructor 12.8.18 . 

'= default' still counts as user-defined to the best of my understanding.

MSVC, clang and gcc all generate assignment operators in the face of deleted copy constructors. None of them seem to follow the deprecation rule.

I agree entirely with your point in principle, but it seems to be at odds with the standard. I think requiring the user to explicitly default the assignment operator by generating a deleted assignment operator is the right thing to do.

================
Comment at: docs/clang-tidy/checks/misc-user-defined-copy-without-assignment.rst:24
@@ +23,3 @@
+    };
+
+Will be matched and fixed to delete the assignment operator:
----------------
How do I go about disabling a check by default?


http://reviews.llvm.org/D16376





More information about the cfe-commits mailing list