<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/121610>121610</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Add a matcher for the name of a `DependentScopeDeclRefExpr`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          HighCommander4
      </td>
    </tr>
</table>

<pre>
    In https://github.com/llvm/llvm-project/issues/120937 we added a new `dependentScopeDeclRefExpr()` matcher, for matching expression node of type `DependentScopeDeclRefExpr`.

To make this matcher more useful, it would be nice to have a matcher that can go inside `dependentScopeDeclRefExpr()` to narrow down the match to expressions referencing a particular name.

We have such a matcher for `CXXDependentScopeMemberExpr`, called [`hasMemberName()`](https://searchfox.org/llvm/rev/f87a9db8322643ccbc324e317a75b55903129b55/clang/include/clang/ASTMatchers/ASTMatchers.h#3186-3208). I'm proposing we add something similar for `DependentScopeDeclRefExpr`.

We'll need to figure out what to name it. `hasMemberName` is not appropriate here, as `DependentScopeDeclRefExpr` does not necessarily name a class member. `hasName` sounds good but [is already used](https://searchfox.org/llvm/rev/f87a9db8322643ccbc324e317a75b55903129b55/clang/include/clang/ASTMatchers/ASTMatchers.h#3100) for `NamedDecl` and I don't know how easy it would be to overload it. `hasDependentName` perhaps?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMlE-P2zYQxT8NfRnEoEjr30EHN1uje0gPTYDkOiJHEhuKFEjKXn_7gtZ6_7QoEqCXngza5sy833scjNGMjqhj5S-sfNjhmiYfut_MOH3084xOUzjseq-v3aODKaUlMnlk4sTEaTRpWvu98jMTJ2vP948PS_B_kkpMnEyMK0UmToXgrazhQoBakwYERxdgFde0kNPk0mflF3ogZf-g4denJTDRMNGyisOMSU0UmPgIgw_b0bgR6GkJFKPxDpzXBH6AdF0oV33416oV3zN-ZPz4xcOM3wnSZOK9Bcw-EKyRhtXmdibBxa9WQ0_gjCJIHiY8E-DLjTRhAoUORg_GRaPpJ1UlDw5D8BfQ_uIgTbTVzD-8KosQaKBATmXFCAuGZNRqMYDDmZ61fKVtrLiq6c1smRar-Mdv397z-ERzT-EZR9ap0FrSkDNQ8Qnj9offcaaXeVn5wETzPgCRMKhp8E97H8bXDAQ6M3Eamhpb3TdSiOogleqVFAeSRY112Zdly2Uh2r4smTgpiy7fN07ZVdObb46fv3zaxMT3p_3EhJRFU32QgucR9_DIRD3DEvziY4a1ZQ2inynd8hLNbDK4Zyw_kZGvxERtLTginX0ZzLgGAr8muGTfbx7OBCbt4R_kKg4mgvMJcMlTBYOJYKJAGTnGH80A2tN235GiGDEYe936ISiLMcJ863bvfe8a_ep0hNF7Df2asq0mAtpAqK853fr_aSbnTLR3d7IYnYFkReg0PIL2jok6wXfnLzD5CxDG67s3mjz4MwXrUb_x5AXyHdBCYcIs_bTTndStbHFHXVHLsj2UjSx3U6c0SlEXsh6qlg-DHnpJvW4PddFUB17QznSCi5IXXApZcFnuG66Kuu7Loa9E3QwNO3Ca0dh9BpmZ7m7LsCtEURV8Z7EnG29rV4iNkDwOwbtETjMh8jIO3W2d9usY2YFbE1N8rZZMstQdtf7bg8-L5BYSPwD-KGO7Ndjuv2z1m5ZzJ_4KAAD__2H_DqY">