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

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 09:08:17 PDT 2016


alexfh added inline comments.

================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:37
@@ +36,3 @@
+
+void DeletedDefaultCheck::check(const MatchFinder::MatchResult &Result) {
+  const StringRef Message = "%0 is explicitly defaulted but implicitly "
----------------
Will it be less confusing to you, if you change "assignment" to something more generic, e.g. "method" or "decl"?

Also, if you find it less readable that way, we can leave it as is for now.

================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:50
@@ +49,3 @@
+      Diag << "copy constructor"
+           << "a non-static data member or a base class is not copyable";
+    } else if (Constructor->isMoveConstructor()) {
----------------
I usually prefer early returns, however, in this case I find it better to make the code compact. This way it's also immediately clear that the code does nothing but mapping certain properties of matched objects to a message.


http://reviews.llvm.org/D18961





More information about the cfe-commits mailing list