reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/include/clang/ASTMatchers/ASTMatchers.h
 2657   const auto M = isDerivedFrom(hasName(BaseName));
 2690   const auto M = isSameOrDerivedFrom(hasName(BaseName));
 2741   const auto M = isDirectlyDerivedFrom(hasName(BaseName));
tools/clang/lib/ASTMatchers/Dynamic/Registry.cpp
  289   REGISTER_MATCHER(hasName);
tools/clang/lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp
   57   return callee(functionDecl(hasName(FunctionName)));
tools/clang/lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp
  203                   typedefDecl(hasName("CFNumberRef")),
  204                   typedefDecl(hasName("CFBooleanRef")))))))
  214                         cxxRecordDecl(hasName("OSBoolean")),
  215                         cxxRecordDecl(hasName("OSNumber"))
  226                           objcInterfaceDecl(hasName("NSNumber")))))))))))
  244                    typedefDecl(hasName("BOOL"))))).bind("objc_bool_type");
tools/clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
   68   auto DynamicCastM = callExpr(callee(functionDecl(hasName("safeMetaCast"))));
tools/clang/lib/StaticAnalyzer/Checkers/PointerIterationChecker.cpp
   69                                recordDecl(hasName("std::unordered_set")
tools/clang/lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp
   58   return callee(functionDecl(hasName(FunctionName)));
tools/clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp
  143       callExpr(callee(functionDecl(hasName("xpc_main")))).bind(RunLoopRunBind);
tools/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp
  544       anyOf(hasName("exit"), hasName("panic"), hasName("error"),
  544       anyOf(hasName("exit"), hasName("panic"), hasName("error"),
  544       anyOf(hasName("exit"), hasName("panic"), hasName("error"),
  545             hasName("Assert"), hasName("assert"), hasName("ziperr"),
  545             hasName("Assert"), hasName("assert"), hasName("ziperr"),
  545             hasName("Assert"), hasName("assert"), hasName("ziperr"),
  546             hasName("assfail"), hasName("db_error"), hasName("__assert"),
  546             hasName("assfail"), hasName("db_error"), hasName("__assert"),
  546             hasName("assfail"), hasName("db_error"), hasName("__assert"),
  547             hasName("__assert2"), hasName("_wassert"), hasName("__assert_rtn"),
  547             hasName("__assert2"), hasName("_wassert"), hasName("__assert_rtn"),
  547             hasName("__assert2"), hasName("_wassert"), hasName("__assert_rtn"),
  548             hasName("__assert_fail"), hasName("dtrace_assfail"),
  548             hasName("__assert_fail"), hasName("dtrace_assfail"),
  549             hasName("yy_fatal_error"), hasName("_XCAssertionFailureHandler"),
  549             hasName("yy_fatal_error"), hasName("_XCAssertionFailureHandler"),
  550             hasName("_DTAssertionFailureHandler"),
  551             hasName("_TSAssertionFailureHandler")))));
tools/clang/tools/extra/clang-change-namespace/ChangeNamespace.cpp
  388       allOf(hasAncestor(namespaceDecl(hasName(FullOldNs)).bind("ns_decl")),
  391       IsInMovedNs, unless(hasAncestor(namespaceDecl(hasName(Prefix)))));
  410       namespaceDecl(hasName(FullOldNs), isExpansionInFileMatching(FilePattern))
tools/clang/tools/extra/clang-move/Move.cpp
  558     const auto HasName = hasName(("::" + GlobalSymbolName).str());
tools/clang/tools/extra/clang-reorder-fields/ReorderFieldsAction.cpp
   39       match(recordDecl(hasName(RecordName), isDefinition()).bind("recordDecl"),
tools/clang/tools/extra/clang-tidy/abseil/DurationDivisionCheck.cpp
   24       expr(hasType(cxxRecordDecl(hasName("::absl::Duration"))));
tools/clang/tools/extra/clang-tidy/abseil/DurationRewriter.cpp
   94           "e", match(callExpr(callee(functionDecl(hasName(InverseFunction))),
tools/clang/tools/extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
   34         callExpr(callee(functionDecl(hasName(DurationFactory))),
   52         callee(functionDecl(hasName("::absl::FDivDuration"))),
   56         callExpr(callee(functionDecl(hasName(DurationFactory))),
tools/clang/tools/extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp
   70       cxxConstructExpr(hasType(recordDecl(hasName("::absl::string_view"))),
   78                    hasType(recordDecl(hasName("::absl::ByAnyChar"))),
   84   Finder->addMatcher(callExpr(callee(functionDecl(hasName("::absl::StrSplit"))),
   95           callee(functionDecl(hasName("::absl::MaxSplits"))),
tools/clang/tools/extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp
   30                                  hasParent(namespaceDecl(hasName("absl")))))),
tools/clang/tools/extra/clang-tidy/abseil/NoNamespaceCheck.cpp
   25       namespaceDecl(hasName("::absl"), unless(isInAbseilFile()))
tools/clang/tools/extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp
   31       callExpr(callee(functionDecl(hasName("::absl::StrCat"))));
   33       callExpr(callee(functionDecl(hasName("::absl::StrAppend"))));
   65   const auto IsAlphanum = hasDeclaration(cxxMethodDecl(hasName("AlphaNum")));
   66   static const auto* const Strcat = new auto(hasName("::absl::StrCat"));
tools/clang/tools/extra/clang-tidy/abseil/StrCatAppendCheck.cpp
   47   const auto StrCat = functionDecl(hasName("::absl::StrCat"));
   51       argumentCountIs(1), hasType(cxxRecordDecl(hasName("::absl::AlphaNum"))),
tools/clang/tools/extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
   43       callee(cxxMethodDecl(hasName("find"))),
tools/clang/tools/extra/clang-tidy/abseil/TimeSubtractionCheck.cpp
  102         functionDecl(hasName((llvm::Twine("::absl::") + TimeInverse).str()))
  112             callee(functionDecl(hasName(getDurationFactoryForScale(*Scale)))),
  163                          callExpr(callee(functionDecl(hasName(
tools/clang/tools/extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp
   38               0, expr(hasType(cxxRecordDecl(hasName("::absl::Duration"))))),
   52               ofClass(cxxRecordDecl(hasName("::absl::Duration"))),
   70                                   cxxRecordDecl(hasName("::absl::Duration"))))),
   81                    hasName("::absl::operator*"))),
   84                                   cxxRecordDecl(hasName("::absl::Duration"))))))
tools/clang/tools/extra/clang-tidy/android/CloexecAccept4Check.cpp
   22       hasType(pointsTo(recordDecl(isStruct(), hasName("sockaddr"))));
   23   auto SockLenPointerType = hasType(pointsTo(namedDecl(hasName("socklen_t"))));
   26                        functionDecl(returns(isInteger()), hasName("accept4"),
tools/clang/tools/extra/clang-tidy/android/CloexecAcceptCheck.cpp
   21       hasType(pointsTo(recordDecl(isStruct(), hasName("sockaddr"))));
   22   auto SockLenPointerType = hasType(pointsTo(namedDecl(hasName("socklen_t"))));
   25                        functionDecl(returns(isInteger()), hasName("accept"),
tools/clang/tools/extra/clang-tidy/android/CloexecCreatCheck.cpp
   21   auto MODETType = hasType(namedDecl(hasName("mode_t")));
   24                                     hasName("creat"),
tools/clang/tools/extra/clang-tidy/android/CloexecDupCheck.cpp
   21                        functionDecl(returns(isInteger()), hasName("dup"),
tools/clang/tools/extra/clang-tidy/android/CloexecEpollCreate1Check.cpp
   22       Finder, functionDecl(returns(isInteger()), hasName("epoll_create1"),
tools/clang/tools/extra/clang-tidy/android/CloexecEpollCreateCheck.cpp
   21       Finder, functionDecl(returns(isInteger()), hasName("epoll_create"),
tools/clang/tools/extra/clang-tidy/android/CloexecFopenCheck.cpp
   25                                     hasName("fopen"),
tools/clang/tools/extra/clang-tidy/android/CloexecInotifyInit1Check.cpp
   22       Finder, functionDecl(returns(isInteger()), hasName("inotify_init1"),
tools/clang/tools/extra/clang-tidy/android/CloexecInotifyInitCheck.cpp
   21       Finder, functionDecl(returns(isInteger()), hasName("inotify_init")));
tools/clang/tools/extra/clang-tidy/android/CloexecMemfdCreateCheck.cpp
   20       Finder, functionDecl(returns(isInteger()), hasName("memfd_create"),
tools/clang/tools/extra/clang-tidy/android/CloexecOpenCheck.cpp
   28                                     hasName("openat"),
tools/clang/tools/extra/clang-tidy/android/CloexecPipe2Check.cpp
   22                        functionDecl(returns(isInteger()), hasName("pipe2"),
tools/clang/tools/extra/clang-tidy/android/CloexecPipeCheck.cpp
   21                        functionDecl(returns(isInteger()), hasName("pipe"),
tools/clang/tools/extra/clang-tidy/android/CloexecSocketCheck.cpp
   22                                     hasName("socket"),
tools/clang/tools/extra/clang-tidy/boost/UseToStringCheck.cpp
   32                   hasName("std::basic_string"),
   35               hasName("boost::lexical_cast"),
tools/clang/tools/extra/clang-tidy/bugprone/DanglingHandleCheck.cpp
   80           cxxMemberCallExpr(callee(functionDecl(hasName("insert"))),
tools/clang/tools/extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp
   62                          hasName("main"), hasName("swap"),
   62                          hasName("main"), hasName("swap"),
tools/clang/tools/extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp
   31             hasName("value_type"), hasType(BuiltinTypeWithId(ID)))))));
   50       callExpr(callee(functionDecl(hasName("::std::inner_product"),
   59       callExpr(callee(functionDecl(hasName("::std::reduce"),
   67       callExpr(callee(functionDecl(hasName("::std::inner_product"),
tools/clang/tools/extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp
   32                         cxxMemberCallExpr(callee(cxxMethodDecl(hasName("end"))))
   42           callee(cxxMethodDecl(hasName("erase"))), argumentCountIs(1),
tools/clang/tools/extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
   22       hasName("::strlen"), hasName("::std::strlen"), hasName("::strnlen"),
   22       hasName("::strlen"), hasName("::std::strlen"), hasName("::strnlen"),
   22       hasName("::strlen"), hasName("::std::strlen"), hasName("::strnlen"),
   23       hasName("::std::strnlen"), hasName("::strnlen_s"),
   23       hasName("::std::strnlen"), hasName("::strnlen_s"),
   24       hasName("::std::strnlen_s"), hasName("::wcslen"),
   24       hasName("::std::strnlen_s"), hasName("::wcslen"),
   25       hasName("::std::wcslen"), hasName("::wcsnlen"), hasName("::std::wcsnlen"),
   25       hasName("::std::wcslen"), hasName("::wcsnlen"), hasName("::std::wcsnlen"),
   25       hasName("::std::wcslen"), hasName("::wcsnlen"), hasName("::std::wcsnlen"),
   26       hasName("::wcsnlen_s"), hasName("std::wcsnlen_s")));
   26       hasName("::wcsnlen_s"), hasName("std::wcsnlen_s")));
   45       functionDecl(anyOf(hasName("::malloc"), hasName("std::malloc"),
   45       functionDecl(anyOf(hasName("::malloc"), hasName("std::malloc"),
   46                          hasName("::alloca"), hasName("std::alloca")));
   46                          hasName("::alloca"), hasName("std::alloca")));
   48       functionDecl(anyOf(hasName("::calloc"), hasName("std::calloc"),
   48       functionDecl(anyOf(hasName("::calloc"), hasName("std::calloc"),
   49                          hasName("::realloc"), hasName("std::realloc")));
   49                          hasName("::realloc"), hasName("std::realloc")));
tools/clang/tools/extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
   86                               hasUnderlyingDecl(hasName("::std::move")))))
tools/clang/tools/extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
  560       hasDeclaration(cxxRecordDecl(hasName("::std::basic_string"))))));
tools/clang/tools/extra/clang-tidy/bugprone/PosixReturnCheck.cpp
   36               unless(hasName("::posix_openpt")))))),
   45               unless(hasName("::posix_openpt")))))),
   55               unless(hasName("::posix_openpt")))))),
tools/clang/tools/extra/clang-tidy/bugprone/SizeofContainerCheck.cpp
   26                         hasMethod(cxxMethodDecl(hasName("size"), isPublic(),
tools/clang/tools/extra/clang-tidy/bugprone/StringConstructorCheck.cpp
   67           hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
   86           hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
  106       cxxConstructExpr(hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
tools/clang/tools/extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
   28               hasName("::std::basic_string"),
tools/clang/tools/extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
   43                        hasDeclaration(cxxMethodDecl(hasName("basic_string")))),
   47                        hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
tools/clang/tools/extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp
   27           callee(functionDecl(hasName("::memset"))),
   39   Finder->addMatcher(callExpr(callee(functionDecl(hasName("::memset"))),
   46       callExpr(callee(functionDecl(hasName("::memset"))),
tools/clang/tools/extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
   74           hasName("operator="), ofClass(equalsBoundNode("class"))))))));
tools/clang/tools/extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
  310                    callee(cxxMethodDecl(hasName("reset")))),
  326                         unless(callee(functionDecl(hasName("::std::move")))))))
  381       callExpr(callee(functionDecl(hasName("::std::move"))), argumentCountIs(1),
tools/clang/tools/extra/clang-tidy/cert/CommandProcessorCheck.cpp
   22           callee(functionDecl(anyOf(hasName("::system"), hasName("::popen"),
   22           callee(functionDecl(anyOf(hasName("::system"), hasName("::popen"),
   23                                     hasName("::_popen")))
   28           unless(callExpr(callee(functionDecl(hasName("::system"))),
tools/clang/tools/extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp
   25                     anyOf(hasName("std"), hasName("posix")),
   25                     anyOf(hasName("std"), hasName("posix")),
tools/clang/tools/extra/clang-tidy/cert/LimitedRandomnessCheck.cpp
   20   Finder->addMatcher(callExpr(callee(functionDecl(namedDecl(hasName("::rand")),
tools/clang/tools/extra/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp
   52                          member(hasName("seed")),
tools/clang/tools/extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
   45   const auto OwnerDecl = typeAliasTemplateDecl(hasName("::gsl::owner"));
tools/clang/tools/extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
   60               0, hasType(cxxRecordDecl(hasName("::std::array")).bind("type"))),
tools/clang/tools/extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp
  104       objcMethodDecl(isClassMethod(), isDefinition(), hasName("new"))
tools/clang/tools/extra/clang-tidy/google/ExplicitMakePairCheck.cpp
   40                                to(functionDecl(hasName("::std::make_pair"))))
tools/clang/tools/extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  149                                         hasName("::testing::Test"),
  150                                         hasMethod(hasName("SetUpTestSuite")))))
  153                   hasName("test_case_name"),
  156                                         hasName("::testing::TestInfo"),
  157                                         hasMethod(hasName("test_suite_name")))))
  163                                   hasName("::testing::TestEventListener"),
  164                                   hasMethod(hasName("OnTestSuiteStart")))))
  172                                   hasName("::testing::UnitTest"),
  173                                   hasMethod(hasName("current_test_suite")))))
  193       typeAliasDecl(hasName("::testing::TestCase")).bind("test-case");
  248                     hasMethod(cxxMethodDecl(hasName(ReplacementMethod)))),
tools/clang/tools/extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp
   29                   isSameOrDerivedFrom(hasName("::std::exception")))))))))),
tools/clang/tools/extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp
   32                 anyOf(callee(namedDecl(hasName("cast"))),
   33                       callee(namedDecl(hasName("dyn_cast")).bind("dyn_cast")))))
   41                              callee(namedDecl(hasName("cast")))))
   48                 allOf(callee(namedDecl(anyOf(hasName("isa"), hasName("cast"),
   48                 allOf(callee(namedDecl(anyOf(hasName("isa"), hasName("cast"),
   49                                              hasName("cast_or_null"),
   50                                              hasName("dyn_cast"),
   51                                              hasName("dyn_cast_or_null")))
tools/clang/tools/extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp
   21       cxxRecordDecl(hasName("::llvm::Register")).bind("registerClassDecl"));
tools/clang/tools/extra/clang-tidy/llvm/TwineLocalCheck.cpp
   22       qualType(hasDeclaration(recordDecl(hasName("::llvm::Twine"))));
tools/clang/tools/extra/clang-tidy/misc/StaticAssertCheck.cpp
   64                 hasDeclaration(functionDecl(hasName("__builtin_expect"))),
tools/clang/tools/extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
   35                     hasName("operator="), ofClass(recordDecl().bind("class")))
tools/clang/tools/extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
   29               cxxMethodDecl(hasName("reset"),
   30                             ofClass(cxxRecordDecl(hasName("::std::unique_ptr"),
   36                   hasName("release"),
   37                   ofClass(cxxRecordDecl(hasName("::std::unique_ptr"),
tools/clang/tools/extra/clang-tidy/modernize/AvoidBindCheck.cpp
  125           callee(namedDecl(hasName("::std::bind"))),
tools/clang/tools/extra/clang-tidy/modernize/LoopConvertCheck.cpp
  131           callee(cxxMethodDecl(anyOf(hasName("begin"), hasName("cbegin")))))
  131           callee(cxxMethodDecl(anyOf(hasName("begin"), hasName("cbegin")))))
  146       callee(cxxMethodDecl(anyOf(hasName("end"), hasName("cend")))));
  146       callee(cxxMethodDecl(anyOf(hasName("end"), hasName("cend")))));
  252               hasMethod(cxxMethodDecl(hasName("begin"), isConst())),
  253               hasMethod(cxxMethodDecl(hasName("end"),
  258                    cxxRecordDecl(hasMethod(hasName("begin")),
  259                                  hasMethod(hasName("end"))))))) // qualType
  264       callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
  264       callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
tools/clang/tools/extra/clang-tidy/modernize/MakeSharedCheck.cpp
   24           hasName("::std::shared_ptr"), templateArgumentCountIs(1),
tools/clang/tools/extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
  103           callee(cxxMethodDecl(hasName("reset"))),
tools/clang/tools/extra/clang-tidy/modernize/MakeUniqueCheck.cpp
   26           hasName("::std::unique_ptr"), templateArgumentCountIs(2),
   32                          hasName("::std::default_delete"),
tools/clang/tools/extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
   91   auto AutoPtrDecl = recordDecl(hasName("auto_ptr"), isFromStdNamespace());
  112                                    hasName("auto_ptr"), isFromStdNamespace()))))
tools/clang/tools/extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
   39                hasDeclaration(functionDecl(hasName("::std::random_shuffle"))),
tools/clang/tools/extra/clang-tidy/modernize/ShrinkToFitCheck.cpp
   47           callee(cxxMethodDecl(hasName("swap"))),
tools/clang/tools/extra/clang-tidy/modernize/UseAutoCheck.cpp
  128     if (hasName(Name).matches(Node, Finder, Builder))
  162     if (hasName(Name).matches(Node, Finder, Builder))
tools/clang/tools/extra/clang-tidy/modernize/UseEmplaceCheck.cpp
   55       hasDeclaration(functionDecl(hasName("push_back"))),
tools/clang/tools/extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
   27       usingDecl(hasAnyUsingShadowDecl(hasTargetDecl(hasName(MatchText))))
   33       declRefExpr(to(functionDecl(hasName(MatchText))), unless(callExpr()))
   38   Finder->addMatcher(callExpr(hasDeclaration(functionDecl(hasName(MatchText))),
   45                               hasDeclaration(functionDecl(hasName(MatchText))))
tools/clang/tools/extra/clang-tidy/objc/MissingHashCheck.cpp
   46           hasName("isEqual:"), isInstanceMethod(),
   49                              unless(hasInstanceMethod(hasName("hash"))))
tools/clang/tools/extra/clang-tidy/objc/SuperSelfCheck.cpp
   87                               isDerivedFrom(hasName("NSObject"))))))))
tools/clang/tools/extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp
   48                      callee(cxxMethodDecl(hasName("begin"))),
   57                      callee(cxxMethodDecl(hasName("end"))),
tools/clang/tools/extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
   36           hasDeclaration(cxxRecordDecl(hasName("::std::basic_string")))))));
tools/clang/tools/extra/clang-tidy/performance/MoveConstArgCheck.cpp
   47       callExpr(callee(functionDecl(hasName("::std::move"))), argumentCountIs(1),
tools/clang/tools/extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
   93       callExpr(callee(functionDecl(hasName("::fma"), parameterCountIs(3),
  105                    hasName("::frexp"), parameterCountIs(2),
  116       callExpr(callee(functionDecl(hasName("::nexttoward"), parameterCountIs(2),
  128               hasName("::remquo"), parameterCountIs(3),
  138       callExpr(callee(functionDecl(hasName("::scalbln"), parameterCountIs(2),
  147       callExpr(callee(functionDecl(hasName("::scalbn"), parameterCountIs(2),
tools/clang/tools/extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
   39                       hasName("size"),
   43                                 hasName("empty"), returns(booleanType()))
   64                         callee(cxxMethodDecl(hasName("size"))), WrongUse,
tools/clang/tools/extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
   28                  hasName("get"),
   41       has(cxxMethodDecl(hasName("operator->"),
   43       has(cxxMethodDecl(hasName("operator*"), returns(qualType(references(
tools/clang/tools/extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
   75       hasDeclaration(cxxRecordDecl(hasName("::std::basic_string"))))));
   82                        hasDeclaration(cxxMethodDecl(hasName("basic_string")))),
   85           hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
  134                         callee(decl(cxxMethodDecl(hasName("compare")))),
  151                         callee(decl(cxxMethodDecl(hasName("insert")))),
tools/clang/tools/extra/clang-tidy/readability/RedundantStringInitCheck.cpp
   27                        hasDeclaration(cxxMethodDecl(hasName("basic_string")))),
   31                        hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
   50                       hasDeclaration(cxxRecordDecl(hasName("basic_string")))))),
tools/clang/tools/extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
   45               callee(namedDecl(hasName("data"))))
tools/clang/tools/extra/clang-tidy/readability/StringCompareCheck.cpp
   30       callee(cxxMethodDecl(hasName("compare"),
   32                                hasName("::std::basic_string"))))),
tools/clang/tools/extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
   25       hasName("std::unique_ptr"),
   27                                  hasName("std::default_delete")))))));
   34                         callee(cxxMethodDecl(hasName("release")))))))
tools/clang/tools/extra/clang-tidy/utils/NamespaceAliaser.cpp
   48                 has(namespaceAliasDecl(hasTargetNamespace(hasName(Namespace)))
   58     DeclarationMatcher ConflictMatcher = namedDecl(hasName(Abbreviation));
tools/clang/tools/extra/clang-tidy/utils/UsingInserter.cpp
   53                  hasTargetDecl(hasName(QualifiedName.str())))))))),
   61   auto ConflictingDecl = namedDecl(hasName(UnqualifiedName));
tools/clang/tools/extra/unittests/clang-query/QueryEngineTest.cpp
   52   DynTypedMatcher FooMatcher = functionDecl(hasName("foo1"));
tools/clang/tools/extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp
  178       tooling::makeRule(callExpr(callee(functionDecl(hasName("f")))),
tools/clang/unittests/AST/ASTContextParentMapTest.cpp
   30                      cxxMethodDecl(hasParent(recordDecl(hasName("C"))))));
   57       cxxMethodDecl(hasName("f"),
   62       cxxMethodDecl(hasName("f"),
   68           hasName("f"),
  112       varDecl(hasName("y"), hasAncestor(functionDecl(
tools/clang/unittests/AST/ASTImporterGenericRedeclTest.cpp
   25     return functionDecl(hasName("X"), unless(isImplicit()));
   34     return cxxRecordDecl(hasName("X"), unless(isImplicit()));
   42   BindableMatcher<Decl> getPattern() { return varDecl(hasName("X")); }
   55     return functionTemplateDecl(hasName("X"), unless(isImplicit()));
   64     return classTemplateDecl(hasName("X"), unless(isImplicit()));
   89     return functionDecl(hasName("X"), isExplicitTemplateSpecialization());
  106     return classTemplateSpecializationDecl(hasName("X"), unless(isImplicit()));
tools/clang/unittests/AST/ASTImporterODRStrategiesTest.cpp
   38     return functionDecl(hasName("X"), unless(isImplicit()));
   47   BindableMatcher<Decl> getPattern() { return typedefNameDecl(hasName("X")); }
   55   BindableMatcher<Decl> getPattern() { return typedefNameDecl(hasName("X")); }
   63   BindableMatcher<Decl> getPattern() { return enumDecl(hasName("X")); }
   71   BindableMatcher<Decl> getPattern() { return enumConstantDecl(hasName("X")); }
   81     return cxxRecordDecl(hasName("X"), unless(isImplicit()));
   92   BindableMatcher<Decl> getPattern() { return varDecl(hasName("X")); }
  105     return classTemplateDecl(hasName("X"), unless(isImplicit()));
  124     return functionTemplateDecl(hasName("X"), unless(isImplicit()));
  146   BindableMatcher<Decl> getPattern() { return varTemplateDecl(hasName("X")); }
  168     return classTemplateSpecializationDecl(hasName("X"), unless(isImplicit()));
  198     return functionDecl(hasName("X"), isExplicitTemplateSpecialization(),
  223     return varTemplateSpecializationDecl(hasName("X"), unless(isImplicit()));
tools/clang/unittests/AST/ASTImporterTest.cpp
  117             has(namedDecl(hasName(DeclToImportID)).bind(DeclToImportID))),
  154           ImportPredicate(namedDecl(hasName(DeclName))) {}
  256   auto Pattern = functionDecl(hasName("f"));
  266   auto Pattern = functionDecl(hasName("f"));
  280   auto Pattern = functionDecl(hasName("f"));
  339   auto Pattern = functionDecl(hasName("shouldNotBeImported"));
  356   auto Pattern = functionDecl(hasName("shouldNotBeImported"));
  367     auto Pattern = functionDecl(hasName("f"));
  572                   declRefExpr(hasDeclaration(varDecl(hasName("ptr"))),
  584               labelStmt(hasDeclaration(labelDecl(hasName("loop"))))),
  586               addrLabelExpr(hasDeclaration(labelDecl(hasName("loop")))))));
  605                   hasName("f"),
  628             hasName("C"),
  634                             hasName("X"),
  832               hasName("pi"), unless(varTemplateSpecializationDecl()))))))));
  925               hasName("a"), hasInitializer(hasDescendant(cxxTypeidExpr())))),
  927               hasName("b"), hasInitializer(hasDescendant(cxxTypeidExpr()))))));
  952                  has(declStmt(hasSingleDecl(varDecl(hasName("d")))))))));
  963       FirstDeclMatcher<VarDecl>().match(FromTU, varDecl(hasName("d")));
  976       FromTU, functionDecl(hasName("declToImport")));
  988       FromTU, functionDecl(hasName("declToImport")));
  993       To, functionDecl(hasName("declToImport"),
 1005       FromTU, functionDecl(hasName("declToImport")));
 1105           unless(has(functionDecl(hasName("declToImport"))))))));
 1111           unless(has(cxxRecordDecl(hasName("declToImport"))))))));
 1154       FromTU, functionDecl(hasName("f")));
 1247                                                       hasName("S2")));
 1251                                                       hasName("S2")));
 1303   auto Matcher = functionDecl(hasName("declToImport"),
 1305                               hasParameter(0, hasName("y")),
 1306                               hasParameter(1, hasName("x")),
 1415       hasName("Base"), has(classTemplateSpecializationDecl()))));
 1453       hasName("X"), unless(has(classTemplateSpecializationDecl())))));
 1459   Pattern = namespaceDecl(has(classTemplateSpecializationDecl(hasName("X"))));
 1571       hasName("Base"),
 1615       hasName("Base"),
 1616       has(classTemplateSpecializationDecl(has(fieldDecl(hasName("a"))))))));
 1633         FromTU, classTemplateDecl(hasName("B")));
 1648         FromTU, functionDecl(hasName("f")));
 1651         FromTU, classTemplateDecl(hasName("B")));
 1685       FromTU, classTemplateDecl(hasName("B")));
 1719       FromTU, cxxRecordDecl(hasName("B")));
 1819       FromTU, classTemplateSpecializationDecl(hasName("B")));
 1840       FirstDeclMatcher<VarDecl>().match(FromTU, varDecl(hasName("object0")));
 1843       FirstDeclMatcher<VarDecl>().match(FromTU, varDecl(hasName("object1")));
 1868       FirstDeclMatcher<RecordDecl>().match(FromTU0, recordDecl(hasName("X")));
 1870       FirstDeclMatcher<RecordDecl>().match(FromTU1, recordDecl(hasName("X")));
 1878             DeclCounter<RecordDecl>().match(ToTU, recordDecl(hasName("X"))));
 1901       FirstDeclMatcher<RecordDecl>().match(FromTU0, recordDecl(hasName("X")));
 1903       FirstDeclMatcher<RecordDecl>().match(FromTU1, recordDecl(hasName("X")));
 1911             DeclCounter<RecordDecl>().match(ToTU, recordDecl(hasName("X"))));
 1915   auto Pattern = varDecl(hasName("x"));
 1934         FromTU, functionDecl(hasName("f")));
 1941   auto Pattern = varDecl(hasName("x"));
 1952         FromTU, functionDecl(hasName("f")));
 1959   auto Pattern = varDecl(hasName("a"));
 1981         FromTU, functionDecl(hasName("f")));
 1990   auto Pattern = varDecl(hasName("x"));
 2010   auto Pattern = functionDecl(hasName("f"));
 2028   auto Pattern = functionDecl(hasName("f"));
 2052       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2052       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2069       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2069       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2112       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2112       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2114       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2114       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2142       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2142       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2144       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2144       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2146       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2146       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2148       hasName("f"), hasParent(cxxRecordDecl(hasName("D"))), isDefinition());
 2148       hasName("f"), hasParent(cxxRecordDecl(hasName("D"))), isDefinition());
 2149   auto FDefAllP = cxxMethodDecl(hasName("f"), isDefinition());
 2180       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2180       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2182       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2182       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2183   auto DFP = cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))),
 2183   auto DFP = cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))),
 2200       ToTU, cxxRecordDecl(hasName("B")));
 2203       ToTU, cxxMethodDecl(hasName("f"), isDefinition()));
 2233       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2233       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("B"))));
 2235       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2235       hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
 2237       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2237       cxxMethodDecl(hasName("f"), hasParent(cxxRecordDecl(hasName("D"))));
 2239       hasName("f"), hasParent(cxxRecordDecl(hasName("D"))), isDefinition());
 2239       hasName("f"), hasParent(cxxRecordDecl(hasName("D"))), isDefinition());
 2240   auto FooDef = functionDecl(hasName("foo"));
 2262       ToTU, cxxRecordDecl(hasName("B")));
 2264       ToTU, cxxRecordDecl(hasName("D")));
 2267       ToTU, cxxMethodDecl(hasName("f"), isDefinition()));
 2270       ToTU, cxxMethodDecl(hasName("f"), isDefinition()));
 2292     auto Pattern = varDecl(hasName("v"));
 2313   auto Pattern = functionDecl(hasName("f"));
 2332         FromTU, functionDecl(hasName("g0")));
 2341         FromTU, functionDecl(hasName("g1")));
 2346   ASSERT_EQ(DeclCounter<FunctionDecl>().match(ToTU, functionDecl(hasName("f"))),
 2359       FromTU, functionDecl(hasName("foo")));
 2385       FromTU, functionDecl(hasName("f")));
 2389       ToD, functionDecl(hasName("f"), hasDescendant(declRefExpr()))));
 2411       FromTU, functionDecl(hasName("g")));
 2417                 functionDecl(hasName("f"), hasDescendant(declRefExpr()))))));
 2432       FromTU1, functionTemplateDecl(hasName("f")));
 2436       FromTU2, functionTemplateDecl(hasName("f")));
 2454       FromTU1, functionTemplateDecl(hasName("f")));
 2458       FromTU2, functionTemplateDecl(hasName("f")));
 2474       FromTU, functionDecl(hasName("foo")));
 2522   auto Pattern = functionDecl(hasName("f"));
 2541   auto Pattern = functionDecl(hasName("f"));
 2558   auto Pattern = functionDecl(hasName("f"));
 2577   auto Pattern = functionDecl(hasName("f"));
 2594   auto Pattern = functionDecl(hasName("f"));
 2623   auto Pattern = functionDecl(hasName("f"));
 2651   auto Pattern = functionDecl(hasName("f"));
 2675   auto FunctionPattern = functionDecl(hasName("f"));
 2676   auto ClassPattern = cxxRecordDecl(hasName("X"));
 2709   auto FunctionPattern = functionDecl(hasName("f"));
 2710   auto ClassPattern = cxxRecordDecl(hasName("X"));
 2759   auto FunctionPattern = functionDecl(hasName("f"));
 2760   auto ClassPattern = cxxRecordDecl(hasName("X"));
 2803   auto Pattern = functionDecl(hasName("f"));
 2852       FromTU, functionDecl(hasName("f")));
 2855       FromTU, cxxRecordDecl(hasName("X")));
 2868       ToTU, cxxRecordDecl(hasName("X")));
 2907       enumDecl(has(enumConstantDecl(hasName("THING_VALUE"))),
 2908                hasTypedefForAnonDecl(hasName("thing_t")));
 2910   ImportAction ImportFoo{"foo.c", "main.c", functionDecl(hasName("foo"))},
 2911       ImportMoo{"moo.c", "main.c", functionDecl(hasName("moo"))};
 3097   testNoImportOf(cxxMethodDecl(hasName("f")), Code);
 3106         FromTU, cxxRecordDecl(hasName("A")));
 3116         FromTU, cxxRecordDecl(hasName("A")));
 3130         FromTU, cxxRecordDecl(hasName("A")));
 3138         FromTU, cxxRecordDecl(hasName("A")));
 3150         FromTU, fieldDecl(hasName("x")));
 3158         FromTU, fieldDecl(hasName("x")));
 3170         FromTU, fieldDecl(hasName("x")));
 3178         FromTU, fieldDecl(hasName("x")));
 3190         FromTU, functionDecl(hasName("x"), isDefinition()));
 3198         FromTU, functionDecl(hasName("x"), isDefinition()));
 3211         FromTU, functionDecl(hasName("x"), isDefinition()));
 3220         FromTU, functionDecl(hasName("x"), isDefinition()));
 3241       FirstDeclMatcher<RecordDecl>().match(FromTU, recordDecl(hasName("A")));
 3247       FirstDeclMatcher<FieldDecl>().match(ToTU, fieldDecl(hasName("entry0")));
 3249       FirstDeclMatcher<FieldDecl>().match(ToTU, fieldDecl(hasName("entry1")));
 3254       R0, recordDecl(has(fieldDecl(hasName("next"))))));
 3256       R1, recordDecl(has(fieldDecl(hasName("next"))))));
 3268       FromTU, functionDecl(hasName("f")));
 3313       ToTU, classTemplateSpecializationDecl(hasName("X")));
 3326       FromTU, classTemplateSpecializationDecl(hasName("X")));
 3365       FromTU, classTemplateSpecializationDecl(hasName("X")));
 3366   auto FunPattern = functionDecl(hasName("g"),
 3377       ToTU, classTemplateSpecializationDecl(hasName("X")));
 3412       FromTU, classTemplateSpecializationDecl(hasName("X")));
 3424                 ToTU, classTemplateSpecializationDecl(hasName("X"))));
 3450       FromTU, classTemplateSpecializationDecl(hasName("X")));
 3464       ToTU, classTemplateSpecializationDecl(hasName("X")));
 3561   auto *FromD = FirstDeclMatcher<VarDecl>().match(TU, varDecl(hasName("a")));
 3586       FromTU, varDecl(hasName("a"))); // Decl with init
 3588       FromTU, varDecl(hasName("a"))); // Decl with definition
 3612       FromTU, varDecl(hasName("a"))); // Decl with init
 3614       FromTU, varDecl(hasName("a"))); // Decl with definition
 3622       ToTU, varDecl(hasName("a"))); // Decl with init
 3643       FromTU, varDecl(hasName("a")));
 3645       FromTU, varDecl(hasName("a"))); // Decl with definition and with init.
 3653       ToTU, varDecl(hasName("a")));
 3667   auto Pattern = recordDecl(hasName("X"), unless(isImplicit()));
 3685   auto Pattern = recordDecl(hasName("X"), unless(isImplicit()));
 3703   auto Pattern = recordDecl(hasName("X"), unless(isImplicit()));
 3738       FromTU, cxxRecordDecl(hasName("F"), isDefinition()));
 3740       FromTU, cxxRecordDecl(hasName("F")));
 3772       FromTu, cxxRecordDecl(hasName("declToImport")));
 3805   auto Pattern = classTemplateSpecializationDecl(hasName("X"));
 3849       FromTU0, classTemplateDecl(hasName("F")));
 3858       FromTU1, classTemplateDecl(hasName("F")));
 3888       ToTU, classTemplateDecl(hasName("F")));
 3896       FromTU, classTemplateDecl(hasName("F")));
 3918       FromTU0, classTemplateDecl(hasName("F")));
 3927       FromTU1, classTemplateDecl(hasName("F")));
 3957       FromTU1, cxxRecordDecl(hasName("F")));
 3972       ToTU, functionDecl(hasName("foo")));
 3976       FromTU, functionDecl(hasName("foo")));
 4013   auto *A0 = FirstDeclMatcher<VarDecl>().match(TU, varDecl(hasName("A")));
 4014   auto *A1 = LastDeclMatcher<VarDecl>().match(TU, varDecl(hasName("A")));
 4060       unless(has(functionDecl(hasName("f"), isTemplateInstantiation()))));
 4064       FromTU, functionDecl(hasName("foo")));
 4083   auto Instantiation = functionDecl(hasName("f"), isTemplateInstantiation());
 4107       functionDecl(hasName("f"), isExplicitTemplateSpecialization());
 4129   auto Spec = functionDecl(hasName("f"), isExplicitTemplateSpecialization(),
 4173       FromTU, functionDecl(hasName("foo")));
 4178       DeclCounter<FunctionDecl>().match(FromTU, functionDecl(hasName("f"))),
 4179       DeclCounter<FunctionDecl>().match(ToTU, functionDecl(hasName("f"))));
 4192         FromTU, classTemplateDecl(hasName("B")));
 4208         FromTU, functionDecl(hasName("f")));
 4211         FromTU, classTemplateDecl(hasName("B")));
 4234       typedefNameDecl(hasName("U")));
 4246       typedefNameDecl(hasName("U")));
 4264       functionDecl(hasName("f"), isExplicitTemplateSpecialization()));
 4276   auto *D = FirstDeclMatcher<VarDecl>().match(ToTU, varDecl(hasName("a")));
 4302       ToTU, classTemplateDecl(hasName("X")));
 4304       ToTU, functionDecl(hasName("foo")));
 4338       FirstDeclMatcher<RecordDecl>().match(ToTU, recordDecl(hasName("Foo")));
 4340       FirstDeclMatcher<RecordDecl>().match(ToTU, recordDecl(hasName("A")));
 4373                               .match(ToTU, varDecl(hasName("V")))
 4376       FirstDeclMatcher<RecordDecl>().match(ToTU, recordDecl(hasName("A")));
 4378       FirstDeclMatcher<RecordDecl>().match(ToTU, recordDecl(hasName("B")));
 4385                         ToTU, fieldDecl(hasName("V"),
 4386                                         hasParent(recordDecl(hasName("A"))))));
 4390                         ToTU, fieldDecl(hasName("V"),
 4391                                         hasParent(recordDecl(hasName("B"))))));
 4395                         ToTU, varDecl(hasName("V"),
 4497       ToTU, cxxRecordDecl(hasName("Y")));
 4522   auto *Y = FirstDeclMatcher<CXXRecordDecl>().match(ToTU, cxxRecordDecl(hasName("Y")));
 4548       ToTU, typeAliasDecl(hasName("alias_of_f")));
 4563       ToTU, classTemplateDecl(hasName("F")));
 4586       ToTU, classTemplateDecl(hasName("F")));
 4608       ToTU, classTemplateDecl(hasName("F")));
 4626       FirstDeclMatcher<FunctionDecl>().match(ToTU, functionDecl(hasName("F")));
 4650       ToTU, classTemplateDecl(hasName("X")));
 4656       ToTU, classTemplateSpecializationDecl(hasName("X")));
 4691       ToTU, functionTemplateDecl(hasName("F")));
 4714       ToTU, cxxRecordDecl(hasName("X")));
 4739   auto *E = FirstDeclMatcher<EnumDecl>().match(ToTU, enumDecl(hasName("E")));
 4741       ToTU, enumConstantDecl(hasName("A")));
 4778       LastDeclMatcher<NamespaceDecl>().match(ToTU, namespaceDecl(hasName("N")));
 4779   auto *A = FirstDeclMatcher<VarDecl>().match(ToTU, varDecl(hasName("A")));
 4807       FromTU, cxxRecordDecl(hasName("X"), unless(isImplicit())));
 4810       cxxRecordDecl(hasName("X"), isDefinition(), unless(isImplicit())));
 4838       ToTU, functionTemplateDecl(hasName("foo")));
 4846       FromTU, functionTemplateDecl(hasName("foo")));
 4893       FromTU, classTemplateSpecializationDecl(hasName("X")));
 4899                 ToTU, classTemplateSpecializationDecl(hasName("X"))),
 4917       FromTU, functionDecl(hasName("foo")));
 4925       DeclCounter<FunctionDecl>().match(ToTU, functionDecl(hasName("foo"))),
 4945       FromTU, functionDecl(hasName("f")));
 4947       LastDeclMatcher<FunctionDecl>().match(FromTU, functionDecl(hasName("f")));
 4954   EXPECT_EQ(DeclCounter<FunctionDecl>().match(ToTU, functionDecl(hasName("f"))),
 4958       FirstDeclMatcher<FunctionDecl>().match(ToTU, functionDecl(hasName("f")));
 4983       FromTU, cxxRecordDecl(hasName("X")));
 4995       FromTU, cxxMethodDecl(hasName("f")));
 5005       FromTU, cxxMethodDecl(hasName("ok")));
 5036       FromTU, cxxRecordDecl(hasName("F"), isDefinition()));
 5038       FromTU, cxxRecordDecl(hasName("A"), isDefinition()));
 5040       FromTU, cxxRecordDecl(hasName("B"), isDefinition()));
 5042       FromTU, namespaceDecl(hasName("NS")));
 5078           FromTU, classTemplateDecl(hasName("F"))));
 5089           FromTU, cxxRecordDecl(hasName("A"), isImplicit())));
 5094           FromTU, cxxRecordDecl(hasName("X"), isImplicit())));
 5109       FromTU, namespaceDecl(hasName("X")));
 5120       FromTU, functionDecl(hasName("f")));
 5130       FromTU, functionDecl(hasName("ok")));
 5155         FromTU, cxxRecordDecl(hasName("X")));
 5167       ToTU, cxxRecordDecl(hasName("X"), isDefinition()));
 5175       ToTU, cxxRecordDecl(hasName("X"), unless(isDefinition())));
 5191         FromTU, cxxRecordDecl(hasName("X")));
 5213       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("A"))));
 5213       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("A"))));
 5215       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("B"))));
 5215       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("B"))));
 5217       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("C"))));
 5217       functionDecl(hasName("foo"), hasAncestor(cxxRecordDecl(hasName("C"))));
 5305       FromTU, functionDecl(hasName("f")));
 5327       ToTU, classTemplateDecl(hasName("Class")));
 5329       ToTU, classTemplateDecl(hasName("Class")));
 5338       FromTU, classTemplateDecl(hasName("Class")));
 5340       FromTU, classTemplateDecl(hasName("Class")));
 5377       ToTU, cxxRecordDecl(hasName("X")));
 5392       FromTU, cxxRecordDecl(hasName("X")));
 5421       ToTU, typedefDecl(hasName(TypeName)));
 5425       FromTU, typedefDecl(hasName(TypeName)));
 5445         FromTU, cxxRecordDecl(hasName("X"), unless(isImplicit())));
 5467       FromTU, cxxRecordDecl(hasName("X")));
 5470       ImportedX, cxxConstructorDecl(hasName("X"), unless(isImplicit())));
 5472       ImportedX, cxxConstructorDecl(hasName("X"), unless(isImplicit())));
 5564       FromTU, functionDecl(hasName("f")));
 5588       FromTU, functionDecl(hasName("f")));
tools/clang/unittests/AST/ASTImporterVisibilityTest.cpp
   28   BindableMatcher<Decl> operator()() { return functionDecl(hasName("f")); }
   32   BindableMatcher<Decl> operator()() { return varDecl(hasName("v")); }
   36   BindableMatcher<Decl> operator()() { return cxxRecordDecl(hasName("X")); }
   40   BindableMatcher<Decl> operator()() { return enumDecl(hasName("E")); }
   44   BindableMatcher<Decl> operator()() { return typedefNameDecl(hasName("T")); }
   49     return functionTemplateDecl(hasName("f"));
tools/clang/unittests/AST/ASTTraverserTest.cpp
   90   auto Result = ast_matchers::match(functionDecl(hasName(Name)).bind("fn"),
  214       classTemplateSpecializationDecl(hasName("templ")).bind("fn"),
tools/clang/unittests/AST/DeclPrinterTest.cpp
  113                             namedDecl(hasName(DeclName)).bind("id"),
  138                             namedDecl(hasName(DeclName)).bind("id"),
  390       functionDecl(hasName("A"), isDefinition()).bind("id"),
  489     functionDecl(hasName("A"), isExplicitTemplateSpecialization()).bind("id"),
  499     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  508     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  517     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  526     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  536     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  546     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  556     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  565     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  574     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  583     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  592     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  602     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  612     cxxConstructorDecl(ofClass(hasName("A"))).bind("id"),
  621     cxxDestructorDecl(ofClass(hasName("A"))).bind("id"),
  630     cxxDestructorDecl(ofClass(hasName("A"))).bind("id"),
  639     cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
  648     cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
  658     cxxMethodDecl(ofClass(hasName("A"))).bind("id"),
  668     cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  678     cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  687     cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  697     cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  706     cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  733       cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  756       cxxMethodDecl(ofClass(hasName("Z"))).bind("id"),
  969     classTemplateDecl(hasName("A")).bind("id"),
  977     classTemplateDecl(hasName("A")).bind("id"),
  985     classTemplateDecl(hasName("A")).bind("id"),
  993     classTemplateDecl(hasName("A")).bind("id"),
 1001     classTemplateDecl(hasName("A")).bind("id"),
 1009     classTemplateDecl(hasName("A")).bind("id"),
 1018     classTemplateDecl(hasName("A")).bind("id"),
 1025     classTemplateDecl(hasName("A")).bind("id"),
 1033     classTemplateDecl(hasName("A")).bind("id"),
 1041     classTemplateDecl(hasName("A")).bind("id"),
 1049     classTemplateDecl(hasName("A")).bind("id"),
 1088     functionTemplateDecl(hasName("A")).bind("id"),
 1096     functionTemplateDecl(hasName("A")).bind("id"),
 1104     functionTemplateDecl(hasName("A")).bind("id"),
 1111     functionTemplateDecl(hasName("A")).bind("id"),
 1118     functionTemplateDecl(hasName("A")).bind("id"),
 1127     functionTemplateDecl(hasName("A")).bind("id"),
 1299     namedDecl(hasName("A:inRange:"),
 1300               hasDescendant(namedDecl(hasName("printThis")))).bind("id"),
 1307     namedDecl(hasName("P1")).bind("id"),
 1311     namedDecl(hasName("P2")).bind("id"),
 1319     namedDecl(hasName("P1")).bind("id"),
tools/clang/unittests/AST/NamedDeclPrinterTest.cpp
  118                                  namedDecl(hasName(DeclName)).bind("id"),
  130                                  namedDecl(hasName(DeclName)).bind("id"),
  142                                  objcPropertyDecl(hasName(DeclName)).bind("id"),
  151   return PrintedDeclMatches(Code, Args, namedDecl(hasName(DeclName)).bind("id"),
tools/clang/unittests/AST/SourceLocationTest.cpp
  526       Code, friendDecl(has(cxxConstructorDecl(ofClass(hasName("B")))))));
  530       Code, friendDecl(has(cxxDestructorDecl(ofClass(hasName("B")))))));
  544       Code, friendDecl(has(cxxConstructorDecl(ofClass(hasName("B")))))));
  548       Code, friendDecl(has(cxxDestructorDecl(ofClass(hasName("B")))))));
tools/clang/unittests/AST/StmtPrinterTest.cpp
   37   return functionDecl(hasName(ContainingFunction),
tools/clang/unittests/AST/StructuralEquivalenceTest.cpp
   76     auto Matcher = namedDecl(hasName(Identifier));
  197       get<1>(Decls), classTemplateDecl(hasName("Base")));
  211       get<1>(Decls), cxxRecordDecl(hasName("X")));
  213       FirstDeclMatcher<FieldDecl>().match(get<1>(Decls), fieldDecl(hasName("a")));
  438       cxxMethodDecl(hasName("foo")));
  483       cxxMethodDecl(hasName("foo")));
  496       functionDecl(hasName("foo")), cxxConstructorDecl(hasName("foo")));
  496       functionDecl(hasName("foo")), cxxConstructorDecl(hasName("foo")));
  503                                          cxxConstructorDecl(hasName("X")));
  511                                          cxxConstructorDecl(hasName("X")));
  519                                          cxxConstructorDecl(hasName("X")));
  545       functionDecl(allOf(hasName("f"), isDefinition())));
  554       functionDecl(allOf(hasName("f"), isDefinition())));
  571       cxxRecordDecl(hasName("A")),
  572       cxxRecordDecl(hasName("B")));
  646       FirstDeclMatcher<FieldDecl>().match(TU, fieldDecl(hasName("entry0")));
  648       FirstDeclMatcher<FieldDecl>().match(TU, fieldDecl(hasName("entry1")));
  673       TU, indirectFieldDecl(hasName("a")));
  677       TU, indirectFieldDecl(hasName("b")));
  706       TU, indirectFieldDecl(hasName("a")));
  712       TU1, indirectFieldDecl(hasName("a")));
  717       FirstDeclMatcher<RecordDecl>().match(TU, recordDecl(hasName("X")));
  719       FirstDeclMatcher<RecordDecl>().match(TU1, recordDecl(hasName("X")));
  746       FirstDeclMatcher<FieldDecl>().match(FromTU, fieldDecl(hasName("entry1")));
  750       FirstDeclMatcher<FieldDecl>().match(ToTU, fieldDecl(hasName("entry0")));
  752       FirstDeclMatcher<RecordDecl>().match(ToTU, recordDecl(hasName("A")));
  770       cxxRecordDecl(hasName("A")));
  864       get<0>(Decls), cxxConstructorDecl(hasName("foo")));
  866       get<1>(Decls), cxxConstructorDecl(hasName("foo")));
  874       get<0>(Decls), cxxConstructorDecl(hasName("foo")));
  876       get<1>(Decls), cxxConstructorDecl(hasName("foo")));
  931       get<0>(Decls), cxxConstructorDecl(hasName("foo<b>")));
  933       get<1>(Decls), cxxConstructorDecl(hasName("foo<b>")));
  941       get<0>(Decls), cxxConstructorDecl(hasName("foo<b>")));
  943       get<1>(Decls), cxxConstructorDecl(hasName("foo<b>")));
  973       Lang_CXX, classTemplateSpecializationDecl(hasName("Primary")));
 1004       Lang_CXX, classTemplateSpecializationDecl(hasName("Primary")));
 1028                                            functionTemplateDecl(hasName("f")));
 1060                                            functionTemplateDecl(hasName("f")));
 1081                                            functionTemplateDecl(hasName("f")));
 1113                                            functionTemplateDecl(hasName("f")));
 1142                                            functionTemplateDecl(hasName("f")));
 1168       classTemplateSpecializationDecl(hasName("Primary")));
 1195       classTemplateSpecializationDecl(hasName("Primary")));
 1221       classTemplateSpecializationDecl(hasName("Primary")));
 1248       classTemplateSpecializationDecl(hasName("Primary")));
 1273       classTemplateSpecializationDecl(hasName("Primary")));
 1312   auto X = findDeclPair<FunctionDecl>(TU, functionDecl(hasName("x")));
 1316       TU, cxxRecordDecl(hasName("A"), unless(isImplicit())))));
 1318       TU, cxxRecordDecl(hasName("B"), unless(isImplicit())))));
 1350       TU, cxxRecordDecl(hasName("C"), unless(isImplicit())));
 1355       TU, cxxRecordDecl(hasName("A"), unless(isImplicit())))));
 1357       TU, cxxRecordDecl(hasName("B"), unless(isImplicit())))));
 1359       findDeclPair<FunctionDecl>(TU, functionDecl(hasName("x")))));
 1361       findDeclPair<FunctionDecl>(TU, functionDecl(hasName("y")))));
 1389       TU, cxxRecordDecl(hasName("C"), unless(isImplicit())));
 1394       TU, cxxRecordDecl(hasName("A"), unless(isImplicit())))));
 1396       findDeclPair<FunctionDecl>(TU, functionDecl(hasName("x")))));
tools/clang/unittests/ASTMatchers/ASTMatchersInternalTest.cpp
   24     DeclarationMatcher HasEmptyName = recordDecl(hasName(""));
   55   DeclarationMatcher HasClassB = just(has(recordDecl(hasName("B")).bind("b")));
   78       polymorphicHas(recordDecl(hasName("B")).bind("b"));
   90       polymorphicHas(recordDecl(hasName("B")));
  177                       functionDecl(isInline(), hasName("f"))));
  179                       namespaceDecl(isInline(), hasName("m"))));
  188                       recordDecl(hasName("X"), isExpansionInMainFile())));
  219       recordDecl(isExpansionInFileMatching("b.*"), hasName("B")), true,
  225       recordDecl(isExpansionInFileMatching("f.*"), hasName("X")), false,
tools/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
   28       callExpr(allOf(callee(functionDecl(hasName("f"))),
   31       callExpr(allOf(callee(functionDecl(hasName("f"))),
   34                                         recordDecl(hasName("T")))))))));
   36       callExpr(allOf(callee(functionDecl(hasName("f"))),
   39                                         recordDecl(hasName("T"))))),
   42       callExpr(allOf(callee(functionDecl(hasName("f"))),
   45                                         recordDecl(hasName("T"))))),
   51   DeclarationMatcher HasClassX = recordDecl(has(recordDecl(hasName("X"))));
   56     recordDecl(hasName("Y"), has(recordDecl(hasName("X"))));
   56     recordDecl(hasName("Y"), has(recordDecl(hasName("X"))));
   67         has(recordDecl(hasName("X"))),
   68         has(recordDecl(hasName("Y"))),
   69         hasName("Z"))),
   71         has(recordDecl(hasName("A"))),
   72         has(recordDecl(hasName("B"))),
   73         hasName("C"))),
   74       hasName("F"));
  128               hasName("X"))),
  130               hasName("Y"))),
  131             hasName("Z")))),
  134             hasName("C"),
  136               hasName("A"))),
  138               hasName("B")))))),
  139         hasName("F")));
  156       unless(hasName("X")));
  167       hasName("X"),
  168       has(recordDecl(hasName("Z"))),
  170         has(recordDecl(hasName("Y")))));
  176     namedDecl(hasName("Foo"), unless(recordDecl()));
  193       hasDescendant(recordDecl(hasName("X"))),
  194       hasName("Z"));
  208       hasDescendant(recordDecl(has(recordDecl(hasName("Y"))),
  209                                hasName("X"))),
  210       hasName("Z"));
  231       hasDescendant(recordDecl(hasDescendant(recordDecl(hasName("Y"))),
  232                                hasName("X"))),
  233       hasName("Z"));
  257   auto Name = hasName("i");
  293     anyOf(hasName("Y"), allOf(isDerivedFrom("X"), hasName("Z"))));
  293     anyOf(hasName("Y"), allOf(isDerivedFrom("X"), hasName("Z"))));
  301     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U")));
  301     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U")));
  301     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U")));
  301     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U")));
  306     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U"),
  306     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U"),
  306     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U"),
  306     recordDecl(anyOf(hasName("X"), hasName("Y"), hasName("Z"), hasName("U"),
  307                      hasName("V")));
  353     cxxRecordDecl(hasName("Z"), isDerivedFrom("X"));
  355       cxxRecordDecl(hasName("Z"), isDirectlyDerivedFrom("X"));
  484                cxxRecordDecl(isDerivedFrom(recordDecl(hasName("Some"))))));
  491     cxxRecordDecl(hasName("B"), isDerivedFrom(recordDecl(hasName("A"))))));
  491     cxxRecordDecl(hasName("B"), isDerivedFrom(recordDecl(hasName("A"))))));
  498       cxxRecordDecl(hasName("B"),
  499                     isDirectlyDerivedFrom(recordDecl(hasName("A"))))));
  515     varDecl(hasName("z_float"),
  519     varDecl(hasName("z_float"),
  523     varDecl(hasName("z_char"),
  540     varDecl(hasName("z_float"),
  544     varDecl(hasName("z_float"),
  548     varDecl(hasName("z_char"),
  560     cxxRecordDecl(isDerivedFrom(recordDecl(hasName("X")).bind("test")))));
  566     cxxRecordDecl(isDerivedFrom(namedDecl(hasName("X"))))));
  624       objcInterfaceDecl(hasName("Z"), isDerivedFrom("X"));
  626       objcInterfaceDecl(hasName("Z"), isDirectlyDerivedFrom("X"));
  688   DeclarationMatcher ClassX = has(recordDecl(hasName("::X")).bind("x"));
  697     recordDecl(hasName("A"), has(recordDecl(hasName("B")).bind("b"))));
  697     recordDecl(hasName("A"), has(recordDecl(hasName("B")).bind("b"))));
  704     callExpr(callee(cxxMethodDecl(hasName("x")))).bind("x");
  731   DeclarationMatcher ClassX = recordDecl(hasName("X")).bind("x");
  735       recordDecl(hasName("A"), hasDescendant(ClassX)),
  736       recordDecl(hasName("B"), hasDescendant(ClassX)))),
  800   auto M = varDecl(hasName("X"), hasLocalStorage());
  805   M = varDecl(hasName("X"), hasGlobalStorage());
  823   EXPECT_TRUE(matches(T, varDecl(hasName("x"), hasAutomaticStorageDuration())));
  825     notMatches(T, varDecl(hasName("y"), hasAutomaticStorageDuration())));
  827     notMatches(T, varDecl(hasName("a"), hasAutomaticStorageDuration())));
  829   EXPECT_TRUE(matches(T, varDecl(hasName("y"), hasStaticStorageDuration())));
  830   EXPECT_TRUE(matches(T, varDecl(hasName("a"), hasStaticStorageDuration())));
  831   EXPECT_TRUE(matches(T, varDecl(hasName("b"), hasStaticStorageDuration())));
  832   EXPECT_TRUE(matches(T, varDecl(hasName("c"), hasStaticStorageDuration())));
  833   EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasStaticStorageDuration())));
  839   EXPECT_TRUE(notMatches(T, varDecl(hasName("x"), hasThreadStorageDuration())));
  840   EXPECT_TRUE(notMatches(T, varDecl(hasName("y"), hasThreadStorageDuration())));
  841   EXPECT_TRUE(notMatches(T, varDecl(hasName("a"), hasThreadStorageDuration())));
  847     varDecl(hasName("i"))));
  857     sizeOfExpr(hasArgumentOfType(hasDeclaration(recordDecl(hasName("A")))))));
  859     hasArgumentOfType(hasDeclaration(recordDecl(hasName("string")))))));
  985     hasType(references(recordDecl(hasName("X")))));
 1035                          functionDecl(hasName("~A"), isDefaulted())));
 1037                       functionDecl(hasName("~B"), isDefaulted())));
 1042     notMatches("void Func();", functionDecl(hasName("Func"), isDeleted())));
 1044                       functionDecl(hasName("Func"), isDeleted())));
 1065                       varDecl(hasName("foo"), isConstexpr())));
 1067                       functionDecl(hasName("bar"), isConstexpr())));
 1136                       cxxMethodDecl(isVirtual(), hasName("::X::f"))));
 1143                       cxxMethodDecl(isVirtualAsWritten(), hasName("::A::f"))));
 1147                cxxMethodDecl(isVirtualAsWritten(), hasName("::B::f"))));
 1152                       cxxMethodDecl(isPure(), hasName("::X::f"))));
 1196                       cxxMethodDecl(isOverride(), hasName("::Y::f"))));
 1199                          cxxMethodDecl(isOverride(), hasName("::X::f"))));
 1207             cxxMethodDecl(isOverride(), hasName("::Y::f"))));
 1212     hasArgument(0, declRefExpr(to(varDecl(hasName("y"))))));
 1228     hasArgument(42, declRefExpr(to(varDecl(hasName("y"))))));
 1275                       cxxMethodDecl(isImplicit(), hasName("operator="))));
 1388                       recordDecl(hasName("a::b::C"))));
 1390                       recordDecl(hasName("::a::b::C"))));
 1392                       recordDecl(hasName("b::C"))));
 1394                       recordDecl(hasName("C"))));
 1396                          recordDecl(hasName("c::b::C"))));
 1398                          recordDecl(hasName("a::c::C"))));
 1400                          recordDecl(hasName("a::b::A"))));
 1402                          recordDecl(hasName("::C"))));
 1404                          recordDecl(hasName("::b::C"))));
 1406                          recordDecl(hasName("z::a::b::C"))));
 1408                          recordDecl(hasName("a+b::C"))));
 1410                          recordDecl(hasName("C"))));
 1416             recordDecl(hasName("A::B::C"))));
 1419             recordDecl(hasName("::A::B::C"))));
 1422             recordDecl(hasName("B::C"))));
 1425             recordDecl(hasName("C"))));
 1428                recordDecl(hasName("c::B::C"))));
 1431                recordDecl(hasName("A::c::C"))));
 1434                recordDecl(hasName("A::B::A"))));
 1437                recordDecl(hasName("::C"))));
 1440                recordDecl(hasName("::B::C"))));
 1442                          recordDecl(hasName("z::A::B::C"))));
 1445                recordDecl(hasName("A+B::C"))));
 1450   EXPECT_TRUE(matches(code, recordDecl(hasName("a::b::C"))));
 1451   EXPECT_TRUE(matches(code, recordDecl(hasName("a::C"))));
 1452   EXPECT_TRUE(matches(code, recordDecl(hasName("::a::b::C"))));
 1453   EXPECT_TRUE(matches(code, recordDecl(hasName("::a::C"))));
 1459     matches(code, recordDecl(hasName("a::(anonymous namespace)::C"))));
 1460   EXPECT_TRUE(matches(code, recordDecl(hasName("a::C"))));
 1462     matches(code, recordDecl(hasName("::a::(anonymous namespace)::C"))));
 1463   EXPECT_TRUE(matches(code, recordDecl(hasName("::a::C"))));
 1468                       recordDecl(hasName("A::(anonymous class)::C"))));
 1470                       recordDecl(hasName("::A::(anonymous class)::C"))));
 1472                        recordDecl(hasName("::A::C"))));
 1474                       recordDecl(hasName("A::(anonymous struct)::C"))));
 1476                       recordDecl(hasName("::A::(anonymous struct)::C"))));
 1478                        recordDecl(hasName("::A::C"))));
 1484   EXPECT_TRUE(matches(code, varDecl(hasName("i"))));
 1485   EXPECT_FALSE(matches(code, varDecl(hasName("F()::i"))));
 1487   EXPECT_TRUE(matches(code, fieldDecl(hasName("m"))));
 1488   EXPECT_TRUE(matches(code, fieldDecl(hasName("S::m"))));
 1489   EXPECT_TRUE(matches(code, fieldDecl(hasName("F(int)::S::m"))));
 1490   EXPECT_TRUE(matches(code, fieldDecl(hasName("a::F(int)::S::m"))));
 1491   EXPECT_TRUE(matches(code, fieldDecl(hasName("::a::F(int)::S::m"))));
 1512     recordDecl(hasName("A"), isDefinition());
 1517     varDecl(hasName("a"), isDefinition());
 1522     cxxMethodDecl(hasName("a"), isDefinition());
 1527     objcMethodDecl(hasName("a"), isDefinition());
 1566         hasDeclaration(namedDecl(hasName("x"))))));
 1568         hasDeclaration(namedDecl(hasName("y"))))));
 1609                       memberExpr(member(hasName("first")))));
 1616                          memberExpr(member(hasName("first")))));
 1624                       memberExpr(member(hasName("first")))));
 1638                       fieldDecl(isBitField(), hasName("a"))));
 1640                          fieldDecl(isBitField(), hasName("b"))));
 1642                       fieldDecl(isBitField(), hasBitWidth(2), hasName("a"))));
 1649                         hasName("a"))));
 1652                  fieldDecl(hasInClassInitializer(anything()), hasName("b"))));
 1657     "struct A { int i; };", fieldDecl(isPublic(), hasName("i"))));
 1659     "struct A { int i; };", fieldDecl(isProtected(), hasName("i"))));
 1661     "struct A { int i; };", fieldDecl(isPrivate(), hasName("i"))));
 1664     "class A { int i; };", fieldDecl(isPublic(), hasName("i"))));
 1666     "class A { int i; };", fieldDecl(isProtected(), hasName("i"))));
 1668     "class A { int i; };", fieldDecl(isPrivate(), hasName("i"))));
 1671     "class A { protected: int i; };", fieldDecl(isPublic(), hasName("i"))));
 1673                       fieldDecl(isProtected(), hasName("i"))));
 1675     "class A { protected: int i; };", fieldDecl(isPrivate(), hasName("i"))));
 1678   EXPECT_TRUE(notMatches("int i;", varDecl(isPublic(), hasName("i"))));
 1679   EXPECT_TRUE(notMatches("int i;", varDecl(isProtected(), hasName("i"))));
 1680   EXPECT_TRUE(notMatches("int i;", varDecl(isPrivate(), hasName("i"))));
 1716     memberExpr(hasObjectExpression(hasType(recordDecl(hasName("X")))))));
 1722     memberExpr(hasObjectExpression(hasType(recordDecl(hasName("X")))))));
 1726       hasType(pointsTo(recordDecl(hasName("X"))))))));
 1729                           declRefExpr(to(namedDecl(hasName("t"))))))));
 1733                   declRefExpr(to(namedDecl(hasName("t"))))))));
 1739       memberExpr(hasObjectExpression(hasType(recordDecl(hasName("X")))))));
 1743                           hasType(recordDecl(hasName("X")))))));
 1746                           declRefExpr(to(namedDecl(hasName("t"))))))));
 1754       hasType(pointsTo(recordDecl(hasName("S"))))))));
 1758       hasType(pointsTo(recordDecl(hasName("S"))))))));
 1762   EXPECT_TRUE(notMatches("class X { void m(); };", fieldDecl(hasName("m"))));
 1763   EXPECT_TRUE(notMatches("class X { class m {}; };", fieldDecl(hasName("m"))));
 1764   EXPECT_TRUE(notMatches("class X { enum { m }; };", fieldDecl(hasName("m"))));
 1765   EXPECT_TRUE(notMatches("class X { enum m {}; };", fieldDecl(hasName("m"))));
 1769   EXPECT_TRUE(matches("class X { int m; };", fieldDecl(hasName("m"))));
 1818     recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
 1819                       has(fieldDecl(hasName("b")).bind("v")))),
 1826     recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
 1827                       has(fieldDecl(hasName("b")).bind("v")))),
 1831     recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
 1832                       has(fieldDecl(hasName("b")).bind("v")))),
 1836     recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
 1837                       has(fieldDecl(hasName("b")).bind("v"))))));
 1846     cxxRecordDecl(hasName("::X"), isTemplateInstantiation())));
 1851       fieldDecl(hasType(recordDecl(hasName("A"))))))));
 1857     functionDecl(hasParameter(0, hasType(recordDecl(hasName("A")))),
 1866       fieldDecl(hasType(recordDecl(hasName("A"))))))));
 1874                             unless(hasDescendant(varDecl(hasName("t")))))));
 1882     cxxRecordDecl(hasName("::X"), isTemplateInstantiation())));
 1893     cxxRecordDecl(hasName("::X::Y"), isTemplateInstantiation())));
 1906     cxxRecordDecl(hasName("::X<A>::Y"), unless(isTemplateInstantiation()))));
 1913     cxxRecordDecl(hasName("::X"), isTemplateInstantiation())));
 2227                          cxxRecordDecl(hasName("vector"), isInStdNamespace())));
 2232                       cxxRecordDecl(hasName("vector"), isInStdNamespace())));
 2238                       cxxRecordDecl(hasName("vector"), isInStdNamespace())));
 2250                          cxxRecordDecl(hasName("path"), isInStdNamespace())));
 2263               cxxRecordDecl(hasName("path"),
 2264                             hasAncestor(namespaceDecl(hasName("filesystem"),
 2281     "int i = 1;", varDecl(namedDecl(hasName("i")).bind("name"),
 2300     decl(allOf(recordDecl(hasName("::X::Y")).bind("record"),
 2304                          decl(allOf(recordDecl(hasName("::X")).bind("record"),
 2312       has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
 2313       has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))));
 2318       has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
 2319       has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))));
 2351       hasName("f"), forEachDescendant(varDecl().bind("d")),
 2363       callee(cxxMethodDecl(hasName("data"))),
 2365         varDecl(hasType(recordDecl(hasName("StringRef")))).bind("var")))),
 2367         callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
 2367         callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
 2379       callee(cxxMethodDecl(hasName("data"))),
 2381         varDecl(hasType(recordDecl(hasName("StringRef")))).bind("var")))),
 2383         callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
 2383         callee(cxxMethodDecl(anyOf(hasName("size"), hasName("length")))),
tools/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
   30   EXPECT_FALSE(Finder.addDynamicMatcher(hasName("x"), nullptr));
   40   DeclarationMatcher NamedX = namedDecl(hasName("X"));
   90   DeclarationMatcher ClassX = recordDecl(recordDecl(hasName("X")));
  103     Code, varDecl(hasName("MyVar1"), hasDeclContext(translationUnitDecl()))));
  105     Code, varDecl(hasName("MyVar2"), hasDeclContext(translationUnitDecl()))));
  108     varDecl(hasName("MyVar2"),
  118   DeclarationMatcher ClassX = classTemplateDecl(hasName("X"));
  124   DeclarationMatcher ClassX = classTemplateDecl(hasName("X"));
  132                          classTemplateDecl(hasName("X"),
  133                                            hasDescendant(fieldDecl(hasName("a"))))));
  139                          classTemplateDecl(hasName("X"),
  140                                            hasDescendant(fieldDecl(hasName("a"))))));
  166                       friendDecl(hasType(recordDecl(hasName("X"))))));
  169                       functionDecl(hasName("f"), hasParent(friendDecl()))));
  173   EXPECT_TRUE(notMatches("class X {};", enumDecl(hasName("X"))));
  177   EXPECT_TRUE(matches("enum X {};", enumDecl(hasName("X"))));
  181   DeclarationMatcher Matcher = enumConstantDecl(hasName("A"));
  239     callExpr(hasDeclaration(cxxMethodDecl(hasName("x"))));
  245     cxxMemberCallExpr(on(hasType(recordDecl(hasName("Y")))));
  264     cxxMemberCallExpr(on(hasType(pointsTo(recordDecl(hasName("Y"))))));
  308                       nonTypeTemplateParmDecl(hasName("N"))));
  315                       templateTypeParmDecl(hasName("T"))));
  336                           labelDecl(hasName("FOO"))))));
  370     cxxMemberCallExpr(thisPointerType(recordDecl(hasName("Y"))));
  402         cxxMemberCallExpr(thisPointerType(recordDecl(hasName("Y"))))))));
  426     cxxMemberCallExpr(on(declRefExpr(to(varDecl(hasName("y"))))));
  497   StatementMatcher CallFunctionF = callExpr(callee(functionDecl(hasName("f"))));
  536             functionTemplateDecl(hasName("f"))));
  542                functionTemplateDecl(hasName("f"))));
  549                functionTemplateDecl(hasName("f"),
  551                                       functionDecl(hasName("g"))))))));
  590                       cxxCtorInitializer(forField(hasName("i")))));
 1082                       initListExpr(hasType(recordDecl(hasName("B"))))));
 1086                       declRefExpr(to(functionDecl(hasName("f"))))));
 1103                                            ofClass(hasName("A")))))));
 1107                                            ofClass(hasName("A")))))));
 1121                       usingDecl(hasAnyUsingShadowDecl(hasName("a")))));
 1235       varDecl(hasName("b")))))))));
 1259                       varDecl(hasType(recordDecl(hasName("X"))))));
 1332   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1334   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ptr"),
 1336   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1338   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1340   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1342   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1346   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1348   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1350   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ptr"),
 1352   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ptr"),
 1356   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1358   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1360   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1362   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ref"),
 1364   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ref"),
 1366   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1370   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1372   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1374   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1376   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ref"),
 1378   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("ref"),
 1380   EXPECT_TRUE(matches(Fragment, varDecl(hasName("ref"),
 1390   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("a"),
 1392   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("b"),
 1394   EXPECT_TRUE(matches(Fragment, varDecl(hasName("c"),
 1396   EXPECT_TRUE(matches(Fragment, varDecl(hasName("c"),
 1398   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("c"),
 1400   EXPECT_TRUE(matches(Fragment, varDecl(hasName("d"),
 1402   EXPECT_TRUE(matches(Fragment, varDecl(hasName("d"),
 1404   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("d"),
 1406   EXPECT_TRUE(matches(Fragment, varDecl(hasName("e"),
 1408   EXPECT_TRUE(notMatches(Fragment, varDecl(hasName("e"),
 1410   EXPECT_TRUE(matches(Fragment, varDecl(hasName("e"),
 1435   EXPECT_TRUE(matches("typedef int X; X a;", varDecl(hasName("a"),
 1447                       recordType(hasDeclaration(recordDecl(hasName("S"))))));
 1449                          recordType(hasDeclaration(recordDecl(hasName("S"))))));
 1501                       namespaceAliasDecl(hasName("alias"))));
 1506     specifiesType(hasDeclaration(recordDecl(hasName("A")))));
 1515     specifiesNamespace(hasName("ns")));
 1578     "class X { class Y {}; };", recordDecl(hasName("::X::Y")).bind(""),
 1585     fieldDecl(hasName("y"), hasType(type().bind(""))).bind("decl"),
 1591                       typedefDecl(hasName("typedefDeclTest"))));
 1593                          typedefDecl(hasName("typedefDeclTest2"))));
 1598                       typeAliasDecl(hasName("typeAliasTest2"))));
 1600                          typeAliasDecl(hasName("typeAliasTest"))));
 1605                       typedefNameDecl(hasName("typedefNameDeclTest1"))));
 1607                       typedefNameDecl(hasName("typedefNameDeclTest2"))));
 1621       matches(Code, typeAliasTemplateDecl(hasName("typeAliasTemplateDecl"))));
 1623       notMatches(Code, typeAliasTemplateDecl(hasName("typeAliasDecl"))));
 1706     objcProtocolDecl(hasName("Proto"))));
 1709     objcImplementationDecl(hasName("Thing"))));
 1712     objcCategoryDecl(hasName("ABC"))));
 1715     objcCategoryImplDecl(hasName("ABC"))));
 1718     objcMethodDecl(hasName("protoDidThing"))));
 1721     objcMethodDecl(hasName("abc_doThing"))));
 1724     objcMethodDecl(hasName("anything"))));
 1727     objcIvarDecl(hasName("_ivar"))));
 1730     objcPropertyDecl(hasName("enabled"))));
tools/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
   23                       cxxRecordDecl(hasMethod(hasName("func")))));
   35     cxxRecordDecl(hasName("B"), isDerivedFrom(recordDecl()))));
   45     recordDecl(hasDeclContext(namespaceDecl(hasName("M"))))));
   52     recordDecl(hasDeclContext(namespaceDecl(hasName("N"))))));
   60                         hasName("M"), hasDeclContext(namespaceDecl()))))));
  104                       varDecl(hasName("i"), has(isInteger()))));
  106                          varDecl(hasName("i"), has(isInteger()))));
  116     varDecl(hasName("i"), hasType(qualType(has(builtinType()))))));
  119     varDecl(hasName("i"), hasType(qualType(has(pointerType()))))));
  124       expr(hasType(pointsTo(recordDecl(hasName("X")))),
  125            has(ignoringParenImpCasts(declRefExpr(to(varDecl(hasName("i")))))));
  135     expr(hasType(pointsTo(recordDecl(hasName("X")))),
  136          hasDescendant(declRefExpr(to(varDecl(hasName("i"))))));
  147   TypeMatcher TypeA = hasDeclaration(recordDecl(hasName("A")));
  160     recordDecl(hasName("A"), has(recordDecl(hasName("B")))));
  160     recordDecl(hasName("A"), has(recordDecl(hasName("B")))));
  166                        varDecl(hasType(namedDecl(hasName("S"))))));
  172                       parmVarDecl(hasType(namedDecl(hasName("I"))))));
  179     parmVarDecl(hasType(pointsTo(objcInterfaceDecl(hasName("Foo")))))));
  185                       parmVarDecl(hasType(namedDecl(hasName("T"))))));
  199                       parmVarDecl(hasType(namedDecl(hasName("S"))))));
  212   EXPECT_TRUE(matches(Using, unresolvedUsingTypenameDecl(hasName("Foo"))));
  214   EXPECT_TRUE(matches(Using, parmVarDecl(hasType(namedDecl(hasName("Foo"))))));
  220                         qualType(hasDeclaration(enumDecl(hasName("X")))))))));
  245                       varDecl(hasName("a"),
  254                         hasDeclaration(namedDecl(hasName("A"))))))));
  258                         hasDeclaration(namedDecl(hasName("A"))))))));
  289                           namedDecl(hasUnderlyingDecl(hasName("::N::f")))))));
  293       unresolvedLookupExpr(hasAnyDeclaration(namedDecl(hasName("::N::f"))))));
  297       unresolvedLookupExpr(hasAnyDeclaration(namedDecl(hasName("::N::f"))))));
  301   TypeMatcher ClassX = hasDeclaration(recordDecl(hasName("X")));
  313   TypeMatcher ClassX = hasDeclaration(recordDecl(hasName("X")));
  324   DeclarationMatcher ClassX = recordDecl(hasName("X"));
  333   DeclarationMatcher ClassX = recordDecl(hasName("X"));
  347                       typedefDecl(hasType(asString("foo")), hasName("bar"))));
  357                       typedefNameDecl(hasType(asString("foo")), hasName("bar"))));
  362                       varDecl(hasName("x"), hasTypeLoc(loc(asString("int"))))));
  371   StatementMatcher CallMethodX = callExpr(callee(cxxMethodDecl(hasName("x"))));
  392     hasArgument(0, declRefExpr(to(varDecl(hasName("y"))))));
  400     hasArgument(42, declRefExpr(to(varDecl(hasName("y"))))));
  406       ignoringParenImpCasts(declRefExpr(to(varDecl(hasName("y"))))));
  449       objcMessageExpr(hasReceiver(declRefExpr(to(varDecl(hasName("x"))))))));
  454       objcMessageExpr(hasReceiver(declRefExpr(to(varDecl(hasName("x"))))))));
  540   auto MatchesY = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("Y")))));
  544   auto MatchesX = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("X")))));
  574       onImplicitObjectArgument(hasType(cxxRecordDecl(hasName("Y")))));
  579       onImplicitObjectArgument(hasType(cxxRecordDecl(hasName("X")))));
  608       memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X")))));
  613       hasObjectExpression(hasType(pointsTo(cxxRecordDecl(hasName("X"))))));
  620     declRefExpr(to(varDecl(hasName("y")))).bind("arg");
  633     declRefExpr(to(varDecl(hasName("y")))).bind("arg");
  662     declRefExpr(to(varDecl(hasName("y")))).bind("arg");
  686     declRefExpr(to(varDecl(hasName("y")))).bind("arg");
  734                          cxxMethodDecl(hasParameter(0, hasName("x")))));
  736                           objcMethodDecl(hasParameter(0, hasName("x")))));
  738                           blockDecl(hasParameter(0, hasName("p")))));
  749     cxxMethodDecl(hasParameter(0, hasType(recordDecl(hasName("X")))))));
  752     cxxMethodDecl(hasParameter(0, hasType(recordDecl(hasName("X")))))));
  755                         0, hasType(pointsTo(recordDecl(hasName("X"))))))));
  758                         0, hasType(references(recordDecl(hasName("X"))))))));
  764     cxxMethodDecl(hasAnyParameter(hasType(recordDecl(hasName("X")))))));
  767     cxxMethodDecl(hasAnyParameter(hasType(recordDecl(hasName("X")))))));
  769                           objcMethodDecl(hasAnyParameter(hasName("x")))));
  771                           blockDecl(hasAnyParameter(hasName("p")))));
  781                         recordDecl(hasName("Y")))))));
  787     cxxMethodDecl(hasAnyParameter(hasType(recordDecl(hasName("X")))))));
  793                            hasType(pointsTo(recordDecl(hasName("X"))))))));
  798                       cxxMethodDecl(hasAnyParameter(hasName("x")))));
  800                          cxxMethodDecl(hasAnyParameter(hasName("x")))));
  825       refersToDeclaration(fieldDecl(hasName("next")))))));
  838       hasDescendant(declRefExpr(to(fieldDecl(hasName("next"))))))))));
  902   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  903   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  914   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  915   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  927   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  928   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T2"))));
  929   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  930   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U2"))));
  942   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  943   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T2"))));
  944   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  945   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U2"))));
  959   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  960   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  973   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("T"))));
  974   EXPECT_TRUE(matches(input, templateTypeParmDecl(hasName("U"))));
  989                       cxxConstructorDecl(ofClass(hasName("Foo")))));
  991                          cxxConstructorDecl(ofClass(hasName("Bar")))));
  996                       cxxDestructorDecl(ofClass(hasName("Foo")))));
 1001                          cxxDestructorDecl(ofClass(hasName("Foo")))));
 1027     forField(hasType(recordDecl(hasName("Baz"))))))));
 1029     forField(hasName("foo_"))))));
 1031     forField(hasName("bar_"))))));
 1033     forField(hasType(recordDecl(hasName("Bar"))))))));
 1057     allOf(forField(hasName("foo_")), isWritten())))));
 1059     allOf(forField(hasName("bar_")), isWritten())))));
 1061     allOf(forField(hasName("bar_")), unless(isWritten()))))));
 1076     hasName("E")))));
 1079     hasName("D")))));
 1082     hasName("D")))));
 1085     hasName("E")))));
 1302     ofClass(hasName("X")))));
 1319     callExpr(callee(cxxMethodDecl(hasName("x"))))));
 1330     recordDecl(hasName("C"), hasDescendant(callExpr(
 1331       callee(cxxMethodDecl(hasName("x"))))))));
 1368     cxxForRangeStmt(hasRangeInit(declRefExpr(to(varDecl(hasName("a"))))))));
 1424     cxxMethodDecl(ofClass(hasName("X"))), true, "-std=gnu++98"));
 1427                       cxxMethodDecl(ofClass(hasName("X")))));
 1433     cxxMethodDecl(ofClass(hasName("X"))), true, "-std=gnu++98"));
 1583       hasName("i"),
 1604                         declRefExpr(to(varDecl(hasName("x")))))))));
 1643                         declRefExpr(to(varDecl(hasName("x")))))))));
 1702                         declRefExpr(to(varDecl(hasName("x")))))))));
 1714                         declRefExpr(to(varDecl(hasName("x")))))))));
 1896                                        recordDecl(hasName("C"), forEach(fieldDecl(hasName("x")).bind("x"))),
 1896                                        recordDecl(hasName("C"), forEach(fieldDecl(hasName("x")).bind("x"))),
 1902                                        recordDecl(hasName("C"), forEach(fieldDecl().bind("f"))),
 1909     recordDecl(hasName("C"),
 1916                                        recordDecl(hasName("C"),
 1917                                                   forEachDescendant(fieldDecl(hasName("x")).bind("x"))),
 1923     isDefinition(), decl().bind("x"), hasName("C"));
 1926     recordDecl(hasName("A"), anyOf(m, forEachDescendant(m))),
 1934     recordDecl(hasName("A"), allOf(hasDescendant(m), anyOf(m, anything()))),
 1942     recordDecl(hasName("C"), forEachDescendant(fieldDecl().bind("f"))),
 1950     recordDecl(hasName("C"), forEachDescendant(recordDecl(
 1993       recordDecl().bind("x"), hasName("::X"),
 1994       anyOf(forEachDescendant(recordDecl(hasName("Y"))), anything())),
 1997     "class X {};", recordDecl(recordDecl().bind("x"), hasName("::X"),
 2008     cxxRecordDecl(decl().bind("x"), hasMethod(hasName("g"))),
 2014                  hasAnyConstructorInitializer(forField(hasName("b")))))),
 2022     functionDecl(decl().bind("x"), hasAnyParameter(hasName("y"))),
 2046     functionDecl(decl().bind("x"), hasAncestor(recordDecl(hasName("::A")))),
 2053     ifStmt(stmt().bind("x"), hasAncestor(recordDecl(hasName("::A")))),
 2057     recordDecl(hasName("::A"), decl().bind("x"), unless(hasName("fooble"))),
 2057     recordDecl(hasName("::A"), decl().bind("x"), unless(hasName("fooble"))),
 2061     cxxConstructorDecl(hasName("::A::A"), decl().bind("x"),
 2062                        forEachConstructorInitializer(forField(hasName("i")))),
 2069     recordDecl(hasName("C"), forEachDescendant(decl().bind("decl"))),
 2073     recordDecl(hasName("C"), forEachDescendant(decl().bind("decl"))),
 2080     recordDecl(hasName("::A"), findAll(recordDecl(hasName("::A")).bind("v"))),
 2080     recordDecl(hasName("::A"), findAll(recordDecl(hasName("::A")).bind("v"))),
 2087     recordDecl(hasName("::A"), findAll(fieldDecl().bind("v"))),
 2094     recordDecl(hasName("::A"),
 2095                findAll(decl(anyOf(recordDecl(hasName("::A")).bind("v"),
 2101     recordDecl(hasName("::A"), findAll(recordDecl(isDefinition()).bind("v"))),
 2108     recordDecl(hasName("C"), hasAncestor(recordDecl(hasName("A"))))));
 2108     recordDecl(hasName("C"), hasAncestor(recordDecl(hasName("A"))))));
 2114     recordDecl(hasName("C"), hasAncestor(recordDecl(hasName("X"))))));
 2114     recordDecl(hasName("C"), hasAncestor(recordDecl(hasName("X"))))));
 2120     varDecl(hasName("c"), hasType(recordDecl(hasName("C"),
 2120     varDecl(hasName("c"), hasType(recordDecl(hasName("C"),
 2121                                              hasAncestor(recordDecl(hasName("A"))))))));
 2133     integerLiteral(equals(42), hasAncestor(functionDecl(hasName("f"))))));
 2163     varDecl(hasName("x"),
 2174               hasAncestor(recordDecl(hasName("A"))))));
 2182         hasAncestor(recordDecl(hasName("A")))))))));
 2330     elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N")))))));
 2336     elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N")))))));
 2352       hasDeclaration(namedDecl(hasName("D")))))))));
 2384                           specifiesNamespace(hasName("a")))))));
 2389                           specifiesNamespace(hasName("a")))))));
 2394                           specifiesNamespace(hasName("a")))))));
 2415     functionDecl(hasName("f"),
 2429                              specifiesNamespace(hasName("a"))))))));
 2434                              specifiesNamespace(hasName("a"))))))));
 2439                              specifiesNamespace(hasName("a"))))))));
 2458     functionDecl(hasName("f"),
 2485     "class X { class Y {}; };", recordDecl(hasName("::X")).bind("X"),
 2487       "X", decl(hasDescendant(recordDecl(hasName("X::Y")).bind("Y"))),
 2490     "class X { class Y {}; };", recordDecl(hasName("::X")).bind("X"),
 2492       "X", decl(hasDescendant(recordDecl(hasName("X::Z")).bind("Z"))),
 2509     "class X { class Y {}; };", recordDecl(hasName("::X")).bind("X"),
 2511       "X", recordDecl(has(recordDecl(hasName("X::Y")).bind("Y"))), "Y")));
 2513     "class X { class Y {}; };", recordDecl(hasName("::X")).bind("X"),
 2515       "X", recordDecl(has(recordDecl(hasName("X::Z")).bind("Z"))), "Z")));
 2544       returnStmt(forFunction(hasName("operator=")),
 2549       returnStmt(forFunction(hasName("operator=")),
 2554       returnStmt(forFunction(hasName("operator()")),
 2556   EXPECT_TRUE(matches(CppString2, returnStmt(forFunction(hasName("F2")))));
 2557   EXPECT_TRUE(notMatches(CppString2, returnStmt(forFunction(hasName("F")))));
 2562     return cxxMethodDecl(ofClass(hasName(ClassName)), isVirtual(),
 2612                             hasParameter(0, parmVarDecl(hasName("p1"))))))));
 2615                             hasParameter(0, parmVarDecl(hasName("p2"))))))));
 2618                                hasParameter(0, parmVarDecl(hasName("p3"))))))));
 2620                                        functionDecl(hasName("bar"))))));
tools/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
  204       functionDecl(hasParameter(0, hasName("a"))));
tools/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
  217                      specifiesType(hasDeclaration(recordDecl(hasName("A")))))))
  373       has(fieldDecl(hasName("Foo"))),
tools/clang/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp
  150                                                       recordDecl(hasName("X"))))
tools/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp
   47   return declRefExpr(to(namedDecl(hasName(Name))));
tools/clang/unittests/Sema/GslOwnerPointerInference.cpp
   25                           hasName("C"), hasAttr(clang::attr::Owner))));
   37                           hasName("C"), hasAttr(clang::attr::Owner))));
   52                           hasName("C"), hasAttr(clang::attr::Owner))));
tools/clang/unittests/StaticAnalyzer/Reusables.h
   37   return findNode<T>(Where, namedDecl(hasName(Name)));
tools/clang/unittests/Tooling/RangeSelectorTest.cpp
  399       matchCode(Code, callExpr(callee(functionDecl(hasName("bar")))).bind(ID));
  560   TestMatch Match = matchCode(Code, functionDecl(hasName("bad")).bind(Fun));
tools/clang/unittests/Tooling/RefactoringCallbacksTest.cpp
   83                              declRefExpr(to(varDecl(hasName("a"))))))))
tools/clang/unittests/Tooling/SourceCodeBuildersTest.cpp
   35   return varDecl(hasName("test_snippet"),
tools/clang/unittests/Tooling/StencilTest.cpp
   39   return varDecl(hasName("stencil_test_snippet"),
tools/clang/unittests/Tooling/TransformerTest.cpp
  145       callExpr(callee(functionDecl(hasName("strlen"))),
  149                                   callee(cxxMethodDecl(hasName("c_str")))))),
  171                                     hasName("proto::ProtoCommandLineFlag"))))
  173                         unless(callee(cxxMethodDecl(hasName("GetProto"))))),
  191   RewriteRule Rule = makeRule(callExpr(callee(functionDecl(hasName("f")))),
  209   RewriteRule Rule = makeRule(callExpr(callee(functionDecl(hasName("f")))),
  228   RewriteRule Rule = makeRule(functionDecl(hasName("bad")).bind(Fun),
  260   testRule(makeRule(declRefExpr(to(functionDecl(hasName("bad")))).bind(Ref),
  287   RewriteRule Rule = makeRule(memberExpr(member(hasName("bad"))).bind(E),
  464                                     hasName("proto::ProtoCommandLineFlag"))))
  466                         unless(callee(cxxMethodDecl(hasName("GetProto"))))),
  500       makeRule(callExpr(callee(functionDecl(hasName("f1")))),
  525       makeRule(callExpr(callee(functionDecl(hasName("f1")))),
  553       makeRule(callExpr(callee(functionDecl(hasName("f1")))),
  558   RewriteRule DeclRule = makeRule(functionDecl(hasName("f2")).bind("fun"),
  620   Transformer T(makeRule(functionDecl(hasName("errorOccurred")),