Hi John, <div>Thank you for the explanation. It's clear now. I will use the ParmVarDecl::getLocation() for the parameter instead.</div><div><div><div><br></div><div>Limin</div><div><br><br><div class="gmail_quote">On Thu, Jul 7, 2011 at 3:03 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
On Jul 7, 2011, at 2:51 PM, Limin Fu wrote:<br>
<br>
> Hello,<br>
><br>
> I am trying to handle C++ templates in my automatic binding tool based on Clang. I run into a problem that requires to determine the location of the first instantiation of a template class.<br>
><br>
> Basically, I have a file that declares a function with parameter of type "std::vector<MyClass>". From the FunctionDecl of that function, I get a TemplateSpecializationType object and then a ClassTemplateSpecializationDecl object for the parameter type. I thought method getPointOfInstantiation() of ClassTemplateSpecializationDecl will give a location in my file, but instead, it gives a location from stl_vector.h.<br>

><br>
> Isn't the instantiation point supposed to be located in my file? Or am I understanding something wrong here? Thanks a lot.<br>
<br>
</div></div>The point of instantiation is the location that actually first forced your template to be instantiated.  Just writing the template specialization type won't do that — it can stay an incomplete type up until something actually tries to look at its members or bases.<br>

<font color="#888888"><br>
John.</font></blockquote></div><br></div></div></div>