<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>If I match a varDecl() that is in a method of a template class I get a match for the template and instantiated templates </div><div>- is there a way to tell the difference by matching some difference in the ancestors of the varDecl node?</div><div><br></div><div>I get a match for the translate::from_object<T> a0(*args); varDecl in the method activate (see below) that has this type:</div><div>from_object<type-parameter-0-0, struct std::__1::integral_constant<_Bool, true> ></div><div><br></div><div>I also get a match that I think is from the instantiation TestFunctoid<int> j(“test”) in tinyFunc - it has this type: "struct translate::from_object<int, std::true_type>"</div><div><br></div><div>There is a clear difference in the name - but I was looking for something that didn’t feel like a hack.</div><div><br></div><div>Are there differences in the AST class node for TestFunctoid when it is a template class vs when it is an instantiated template class?</div><div><br></div><div><br></div><div><font face="Courier"><br></font></div><div><div><font face="Courier">#include <stdio.h></font></div><div><font face="Courier">#include <core/foundation.h></font></div><div><font face="Courier">#include <core/object.h></font></div><div><font face="Courier">#include <core/holder.h></font></div><div><font face="Courier"><br></font></div><div><font face="Courier">namespace asttooling {</font></div><div><font face="Courier"><br></font></div><div><font face="Courier"><br></font></div><div><font face="Courier"> template<typename T></font></div><div><font face="Courier"> class TestFunctoid : public core::Functoid {</font></div><div><font face="Courier"> public:</font></div><div><font face="Courier"><br></font></div><div><font face="Courier"> TestFunctoid(const string& name) : core::Functoid(name) {};</font></div><div><font face="Courier"> core::T_mv activate( core::const_ActivationFrame_spREF closedOverFrame, int numArgs, ArgArray args )</font></div><div><font face="Courier"> {</font></div><div><font face="Courier"> translate::from_object<T> a0(*args);</font></div><div><font face="Courier"> printf( "Address of a0= %p\n", &a0);</font></div><div><font face="Courier"> return Values0<core::T_O>();</font></div><div><font face="Courier"> }</font></div><div><font face="Courier"> };</font></div><div><font face="Courier"><br></font></div><div><font face="Courier"><br></font></div><div><font face="Courier"><br></font></div><div><font face="Courier"> void tinyFunc()</font></div><div><font face="Courier"> {</font></div><div><font face="Courier"> TestFunctoid<int> j("test");</font></div><div><font face="Courier"> TinyStruct x(10);</font></div><div><font face="Courier"> tinyFunc(x);</font></div><div><font face="Courier"> printf("Hi there, this is tinyFunc\n");</font></div><div><font face="Courier"> }</font></div><div><font face="Courier"><br></font></div><div><font face="Courier">};</font></div></div><div><br></div><div>
<div><div>Christian Schafmeister</div><div>Associate Professor</div><div>Chemistry Department</div><div>Temple University</div></div>
</div>
<br></body></html>