<div dir="ltr">I'm looking to create AST matchers for variables that are templated. For example, in the code:<div><br></div><div>template <class T> class Class  // template <(class or typename or int/float/etc) T><br>{<br>public:<br><br>void Func(T* Param)            // 1) match Param<br>{<br>   Param = nullptr;                 // 2) match Param<br>}<br><br>T* Var = nullptr;                    // 3) match Var<br>};<br><br>int main()<br>{<br>   Class<float> MyClass;<br>   float FloatVal;<br>   MyClass.Var = &FloatVal;  // 4) match Var<br>}<br></div><div><br></div><div>Ideally, I'd like one matcher to find each of the 4 matches, but I suspect I need individual matchers for each of them.  For the first match above I have varDecl(hasType(templateTypeParmType())), but I haven't had luck with clang-query in finding the other 3. Any help would be much appreciated!</div><div><br></div><div>Thanks,</div><div>Robert</div><div><br></div><div><br></div></div>