[cfe-dev] Get class template cursor from class template instantiation cursor

Nathan Hüsken nathan.huesken at posteo.de
Wed Feb 13 01:24:09 PST 2013


Hey,

I am traversing a translation unit in the python bindings to libclang.
When I encounter a CXX_BASE_SPECIFIER I want to know which class is
derived from which here.
The base class I get over the USR of the referenced cursor.
The derived class I can get using cursor.lexical_parent.

This is fine, but when the base class is a template instantiation, I do
not want to get the USR of the specific instantiation. Instead I want
the USR of the class template.

How can I get the class template cursor, when I have the class template
instantiation cursor?

Thanks!
Nathan



More information about the cfe-dev mailing list