alexfh added inline comments. Herald added a project: clang.
================ Comment at: clang-tidy/readability/ContainerSizeEmptyCheck.cpp:65 hasType(references(ValidContainer))))), - callee(cxxMethodDecl(hasName("size"))), WrongUse, + callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))), WrongUse, unless(hasAncestor(cxxMethodDecl( ---------------- lebedev.ri wrote: > lebedev.ri wrote: > > This line looks too long, clang-format might be too intrusive, so at least > > ``` > > callee(cxxMethodDecl(anyOf(hasName("size"), > > hasName("length")))), > > WrongUse, > > > > ``` > s/`callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))), > WrongUse,`/`callee(cxxMethodDecl(ContainerLenghtFuncNames)), WrongUse,`/ Please use `hasAnyName(x, y)` instead of `anyOf(hasName(x), hasName(y))`. It's shorter and executes faster (the more arguments it has, the faster it is compared to the corresponding `anyOf(hasName(...), ...)` construct). ================ Comment at: clang-tidy/readability/ContainerSizeEmptyCheck.cpp:207 + "for emptiness instead of '%0'") + << MemberCall->getMethodDecl()->getName() << Hint; ---------------- Did you try without `->getName()`? IIUC, it should work as well. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56644/new/ https://reviews.llvm.org/D56644 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits