Resending since I've seen no reply yet.<div><br></div><div>Same thing with the cursors for a typedef:</div><div><br></div><div>typedef  A< TT2<B, B2> > ZZ;</div><div><br></div><div>How do I figure out whether B2 belongs to A or TT2 if both the templates classes A and TT2 can take a variable amount of template parameters, and A, TT2, B, B2 are all children of ZZ?</div>
<div><br></div><div>Thanks.</div><div><br></div><div>/f<br><br><div class="gmail_quote">Den 14 april 2012 12:37 skrev Fredrik Ehnbom <span dir="ltr"><<a href="mailto:quarnster@gmail.com">quarnster@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I'm walking through the cursor in a translation unit and the cursor for "test" in the following code is of kind FIELD_DECL and has four children:</div>
<div>TEMPLATE_REF -> A</div><div>TEMPLATE_REF -> TT2</div>
<div>TYPE_REF -> B</div><div>TYPE_REF -> B2</div><div><br></div><div>Since they are all children of "test", how can I determine whether B2 is an argument in the instantiation of the template TT2 or A? I tried calling clang_getCursorReferenceNameRange with CXNameRange_WantTemplateArgs on each of these 5 cursor, but in every case the returned range would equal the result of clang_getCursorExtent so that didn't .</div>

<div><br></div><div>Any ideas?</div><div><br></div><div>Thanks</div><div><br></div><div><br></div><div>template <typename T, typename B=int></div><div>class A</div><div>{</div><div>};</div><div><br></div><div>template <typename T2, typename T3=int></div>

<div>class TT2</div><div>{</div><div>};</div><div><br></div><div>class B</div><div>{</div><div>};</div><div><br></div><div>class B2</div><div>{</div><div>};</div><div><br></div><div>class C</div><div>{</div><div>    A< TT2<B, B2> > test;</div>

<div>};</div>
</blockquote></div><br></div>