[libclang] Template parameters of methods defined outside their class

Hi cfe-dev,

In the following C++ code :

template class C {
void bar(T t);
};

template void C::bar(T2 t2) { … }

With the clang API, is there any way to relate template parameter T2 in bar() definition to template parameter T in class C declaration?

In other words, if I get T2 TemplateTypeParmDecl in bar() definition (function parameter) how should I do, with the clang API, to get to template parameter T of class C? How should I know T2 is just another name for T?

Thanks for any help !

Regards.