How to determine if TemplateTypeParmType is template specialization argument?

Hi all,

I'd like to distinguish T in contexts (1) and (2):

template<typename T>
class B<T, int> // 1
{
public:
    static void hello() {}
    T t; // 2
    int t2;
};

Currently I implement VisitTemplateTypeParmTypeLoc in RecursiveASTVisitor, but it visits both 1 and 2, and I need to skip usages of T in contexts like (1).

Hi all,

I'd like to distinguish T in contexts (1) and (2):

template<typename T>
class B<T, int> // 1
{
public:
    static void hello() {}
    T t; // 2
    int t2;
};

Currently I implement VisitTemplateTypeParmTypeLoc in RecursiveASTVisitor,
but it visits both 1 and 2, and I need to skip usages of T in contexts like
(1).

To capture the context, you can implement your own Traverse*() method that
calls to the original; then you know when a visitation was "inside" another
visitation.

Cheers,
/Manuel

Thank you very much!