<div dir="ltr"><div>The declarations of tVal and tParam can be matched by</div><div>  varDecl(hasType(templateTypeParmType()))</div><div>The use of tVal can be matched by</div><div>  declRefExpr(hasDeclaration(varDecl(hasType(templateTypeParmType()))))</div><div><br></div><div><a href="https://godbolt.org/z/B3SuC3">https://godbolt.org/z/B3SuC3</a><br><div><br></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 23 Jun 2020 at 15:47, Robert Ankeney via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'm looking for a matcher for variables whose type is a template parameter. For example:<div><br></div><div>template<typename T></div><div>T tVal;                       // Match tVal</div><div>int func(T tParam);   // Match tParam</div><div>int i = func(tVal);       // Match tVal</div><div><br></div><div>Our coding standards require the variable to have a 't' at the start of the variable name.</div><div>Looking at the matcher reference, I didn't see anything obvious. Can anyone point me the right direction?</div><div><br></div><div>Many thanks,</div><div>Robert</div><div><br></div></div>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div>