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:
TEMPLATE_REF → A
TEMPLATE_REF → TT2
TYPE_REF → B
TYPE_REF → B2
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 .
Any ideas?
Thanks
template <typename T, typename B=int>
class A
{
};
template <typename T2, typename T3=int>
class TT2
{
};
class B
{
};
class B2
{
};
class C
{
A< TT2<B, B2> > test;
};