@@ -3257,15 +3257,27 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
32573257 });
32583258}
32593259
3260- // / Matches the dependent name of a DependentScopeDeclRefExpr
3260+ // / Matches the dependent name of a DependentScopeDeclRefExpr or
3261+ // / DependentNameType
32613262// /
32623263// / Given:
32633264// / \code
32643265// / template <class T> class X : T { void f() { T::v; } };
32653266// / \endcode
32663267// / \c dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3267- AST_MATCHER_P (DependentScopeDeclRefExpr, hasDependentName, std::string, N) {
3268- return Node.getDeclName ().getAsString () == N;
3268+ // /
3269+ // / Given:
3270+ // / \code
3271+ // / template <typename T> struct declToImport {
3272+ // / typedef typename T::type dependent_name;
3273+ // / };
3274+ // / \endcode
3275+ // / \c dependentNameType(hasDependentName("type")) matches `T::type`
3276+ AST_POLYMORPHIC_MATCHER_P (hasDependentName,
3277+ AST_POLYMORPHIC_SUPPORTED_TYPES (
3278+ DependentScopeDeclRefExpr, DependentNameType),
3279+ std::string, N) {
3280+ return internal::getDependentName (Node) == N;
32693281}
32703282
32713283// / Matches C++ classes that are directly or indirectly derived from a class
@@ -7724,7 +7736,7 @@ AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher<QualType>,
77247736
77257737// / Matches a dependent name type
77267738// /
7727- // / Example matches T::type
7739+ // / Example matches T::type
77287740// / \code
77297741// / template <typename T> struct declToImport {
77307742// / typedef typename T::type dependent_name;
0 commit comments