rsmith added inline comments.

================
Comment at: 
clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:551
     if (Decl->isMain() || !Decl->isUserProvided() ||
-        Decl->isUsualDeallocationFunction() ||
-        Decl->isCopyAssignmentOperator() || Decl->isMoveAssignmentOperator() ||
-        Decl->size_overridden_methods() > 0)
+        Decl->isOverloadedOperator() || Decl->size_overridden_methods() > 0)
       return SK_Invalid;
----------------
I believe the `isOverloadedOperator` check here is redundant. The caller 
already checked that the name is an identifier.

If you want to keep some check of this kind, I'd suggest checking 
`D->getIdentifier()` at the start of this function and removing the check here. 
(Note that `CXXMethodDecl` is not the only `Decl` subclass that can have a 
non-identifier name.)


================
Comment at: clang/lib/AST/DeclCXX.cpp:2068-2076
+  bool Result = true;
+  for (const auto *D : R) {
+    if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
+      Matches.push_back(FD);
       if (FD->getNumParams() == 1)
-        return false;
+        Result = false;
+    }
----------------
I think it would make more sense to put only the 1-parameter functions into 
`Matches`, and rename it to `PreventedBy` or something: then it's the list of 
single-parameter usual deallocation functions that prevent this one being a 
usual deallocation function.


https://reviews.llvm.org/D51808



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to