<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>