[PATCH] D22513: [clang-tidy] add check cppcoreguidelines-rule-of-five-and-zero
Eugene Zelenko via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 19 10:10:46 PDT 2016
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
Please mention this check in docs/ReleaseNotes.rst. See pre-4.0 branch versions as example.
================
Comment at: docs/clang-tidy/checks/cppcoreguidelines-rule-of-five-and-zero.rst:15
@@ +14,3 @@
+
+Note that defining a function with ``=delete`` is considered to be a
+definition.
----------------
Please add space between = and delete.
================
Comment at: test/clang-tidy/cppcoreguidelines-rule-of-five-and-zero.cpp:12
@@ +11,3 @@
+// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesCopyConstructor' defines a copy constructor but does not define or delete all other special member functions [cppcoreguidelines-rule-of-five-and-zero]
+class DefinesCopyAssignment {
+ DefinesCopyAssignment &operator=(const DefinesCopyAssignment &);
----------------
Please separate different cases with empty lines.
================
Comment at: test/clang-tidy/cppcoreguidelines-rule-of-five-and-zero.cpp:39
@@ +38,3 @@
+class DeletesEverything {
+ DeletesEverything(const DeletesEverything &);
+ DeletesEverything &operator=(const DeletesEverything &);
----------------
Looks like = delete is missed fall all class methods.
Repository:
rL LLVM
https://reviews.llvm.org/D22513
More information about the cfe-commits
mailing list