[PATCH] D75911: [clang-tidy] Added hasAnyListedName matcher

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 07:32:15 PDT 2020


njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/Matchers.cpp:17
+
+Matcher<NamedDecl> hasAnyListedName(std::vector<std::string> Names) {
+  return Matcher<NamedDecl>(new HasNameMatcher(std::move(Names)));
----------------
gribozavr2 wrote:
> This matcher sounds generally useful. I think it would be better placed in ASTMatchers.h, WDYT? Can we make it an overload of `hasAnyName`?
`hasAnyName` is a const variable who's type is `VariadicFunction` so it can't be overloaded unfortunately. I personally didn't want it in ASTMatchers.h as its mainly useful for `clang-tidy` checks that load in configurations. It doesn't have a place in say `clang-query`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75911/new/

https://reviews.llvm.org/D75911





More information about the cfe-commits mailing list