[PATCH] D16376: clang-tidy check: misc-deprecated-special-member-functions
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 15 10:46:04 PST 2016
aaron.ballman added a comment.
A few minor nits, but one question (to me) remains: should this be in misc, or is this a cppcoreguideline? I think the check, as is, is acceptable (and can possibly be extended to be a rule-of-five check aliased under cppcoreguidelines), but wanted to understand others' opinions since the categorization has changed a few times.
================
Comment at: clang-tidy/misc/DeprecatedSpecialMemberGenerationCheck.cpp:71
@@ +70,3 @@
+ StringRef DeleteOrDefault =
+ (!dyn_cast<CXXDestructorDecl>(&MatchedDecl) && MatchedDecl.isDefaulted())
+ ? "default"
----------------
Use isa<> instead of dyn_cast<> here since you don't care about the resulting object.
================
Comment at: clang-tidy/misc/DeprecatedSpecialMemberGenerationCheck.cpp:102
@@ +101,3 @@
+
+ std::string FixIt = buildFixIt(MatchedDecl, Class->getName(), S);
+
----------------
No need for FixIt, can just inline buildFixIt below.
Repository:
rL LLVM
http://reviews.llvm.org/D16376
More information about the cfe-commits
mailing list