[clang] [Clang][ASTMatcher] Add a matcher for the name of a DependentScopeDeclRefExpr (PR #121656)
Amr Hesham via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 14:00:33 PST 2025
AmrDeveloper wrote:
> > We can also create a new matcher for `dependentNameType` so we can use it like `dependentNameType(hasDependentType(builtinType()))`, which is similar to Complex and Array types.
>
> I don't think `DependentNameType` has a `Type` property that we could match in this way; the idea behind `DependentNameType` is that resolving it to a concrete `Type` needs to be deferred until after instantiation when the dependent name can be looked up.
>
> That said, it would be useful to have a matcher for the **name** of a `DependentNameType`, something like `dependentNameType(hasDependentName("type"))` for `typename T::type`. I don't know how straightforward it is to overload a matcher name (`hasDependentName` in this case) in this way, but if you're interested in playing around with it, I think that would make for a useful addition!
Thanks for the explanation, I am interested to try to play around with it and will update you with result,
https://github.com/llvm/llvm-project/pull/121656
More information about the cfe-commits
mailing list