[PATCH] D27210: [clang-tidy] misc-string-compare. Adding a new check to clang-tidy

Malcolm Parsons via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 11 13:38:40 PST 2016


malcolm.parsons added inline comments.


================
Comment at: clang-tidy/misc/StringCompareCheck.cpp:25
+      callee(cxxMethodDecl(hasName("compare"),
+                           ofClass(classTemplateSpecializationDecl(
+                               hasName("::std::basic_string"))))),
----------------
malcolm.parsons wrote:
> This needs to check that it's one of the single parameter overloads of compare.
Add `parameterCountIs(1)`.


================
Comment at: clang-tidy/misc/StringCompareCheck.cpp:52
+  // FIXME: Add fixit to fix the code. This seems a little tricky for
+  // cases one and two. Cases three and four seems easy to fix.
+}
----------------
Just fix the easy cases?


https://reviews.llvm.org/D27210





More information about the cfe-commits mailing list