[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 18 14:52:30 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE342514: [clang-tidy] Replace redundant checks with an assert(). (authored by tra, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52179?vs=165841&id=166042#toc

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52179

Files:
  clang-tidy/readability/IdentifierNamingCheck.cpp


Index: clang-tidy/readability/IdentifierNamingCheck.cpp
===================================================================
--- clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -385,6 +385,9 @@
     const NamedDecl *D,
     const std::vector<llvm::Optional<IdentifierNamingCheck::NamingStyle>>
         &NamingStyles) {
+  assert(D && D->getIdentifier() && !D->getName().empty() && !D->isImplicit() &&
+         "Decl must be an explicit identifier with a name.");
+
   if (isa<ObjCIvarDecl>(D) && NamingStyles[SK_ObjcIvar])
     return SK_ObjcIvar;
   
@@ -548,8 +551,6 @@
 
   if (const auto *Decl = dyn_cast<CXXMethodDecl>(D)) {
     if (Decl->isMain() || !Decl->isUserProvided() ||
-        Decl->isUsualDeallocationFunction() ||
-        Decl->isCopyAssignmentOperator() || Decl->isMoveAssignmentOperator() ||
         Decl->size_overridden_methods() > 0)
       return SK_Invalid;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52179.166042.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180918/0e56974e/attachment.bin>


More information about the cfe-commits mailing list