[PATCH] D18961: Add a readability-deleted-default clang-tidy check.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 06:29:07 PDT 2016


aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a comment.

I share David's consideration for making this a compiler warning instead of a clang-tidy check. Perhaps it would make sense to gather some data using this check over some large code bases to see how often it triggers. If it's overly chatty (or we discover interesting usage scenarios), then leaving it as a clang-tidy check may make more sense.


================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:38
@@ +37,3 @@
+void DeletedDefaultCheck::check(const MatchFinder::MatchResult &Result) {
+  const StringRef Message = "%0 is marked '= default' but is actually "
+                            "implicitly deleted, probably because %1; this "
----------------
This is a bit verbose. How about:

"%0 is explicitly defaulted but implicitly deleted, probably because %1; definition can either be removed or explicitly deleted"

?

================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:47
@@ +46,3 @@
+      Diag << "default constructor"
+           << "an instance variable or a base class is lacking a default "
+              "constructor";
----------------
"non-static data member" instead of "instance variable"

================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:55
@@ +54,3 @@
+          << "move constructor"
+          << "an instance variable or a base class is not copyable nor movable";
+    }
----------------
s/not/neither


http://reviews.llvm.org/D18961





More information about the cfe-commits mailing list