Get template class type from a VarDecl

Hi,

I use libclang 3.8 to parse cuda code before it is compiled by the nvidia compiler and tried to ship around the texture type with the following idea:

//---------------------------------------------
// I created a texture template class
template<typename TData1,typename TData2,typename TData3>
class texture
{
public:
typedef TData1 DataOne;
typedef TData2 DataTwo;
typedef TData3 DataThree;
};
//and used it this way

texture<float, 1, cudaReadModeElementType> tex;

//----------------------------------------------

Without the class definition clang_visitChildren() will skip the declaration of tex.

With class “texture” it finds a CXCursor_ClassTemplate and a CXCursor_VarDecl. In this moment the type of the cursor is CXType_Int.

How can I gather the “texture” type?

Best regards,
Albrecht