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

Alex Pilkiewicz via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 01:28:13 PDT 2016


pilki added inline comments.

================
Comment at:  clang-tidy/readability/DeletedDefaultCheck.cpp:35
@@ +34,3 @@
+                     this);
+  Finder->addMatcher(cxxMethodDecl(anyOf(isCopyAssignmentOperator(),
+                                         isMoveAssignmentOperator()),
----------------
alexfh wrote:
> It's not overly important, but you can further reduce the code by folding the first matcher into the second one (move `cxxConstructorDecl()` inside `anyOf` here, since `CXXConstructorDecl` is a `CXXMethodDecl`). You can also use just a single id to bind the node and distinguish the constructor using `dyn_cast`. Then you'll be able to use a single `diag()` call below and remove the unneeded variables `Message` and `isBadlyDefaulted`.
Mmh, I'm not convinced it really helps with readability here. I can do it if you insist though.


http://reviews.llvm.org/D18961





More information about the cfe-commits mailing list