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

Mads Ravn via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 12 02:30:10 PST 2016


Hi Malcolm,

I will look into fixing the two cases only.
argumentCountIs(1) is sufficient to narrow the matching to only string
compare with one argument.

Best regards,
Mads Ravn

On Mon, Dec 12, 2016 at 10:38 AM Malcolm Parsons via Phabricator <
reviews at reviews.llvm.org> wrote:

> 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:
> > malcolm.parsons wrote:
> > > This needs to check that it's one of the single parameter overloads of
> compare.
> > Add `parameterCountIs(1)`.
> Actually, the `argumentCountIs(1)` below should be sufficient.
>
>
> https://reviews.llvm.org/D27210
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161212/299e8cc9/attachment.html>


More information about the cfe-commits mailing list