Access to template parameters via libclang

I'm having some trouble trying to access template parameter types using
libclang. Given the source:

template <typename T>
class List {
    T at(int i);

class Client {
    List<Client> childList();
    List<int> intList();

Navigating the AST with libclang gives the following tree, with each node
annotated with spelling, kind, type and result type:

      class Client:TypeRef:Record:Invalid

Note that the subtree for the childList method helpfully has a TypeRef child
which tells us the return type is List<Client>, but the subtree for intList,
while it tells us that the return type is List<>, has no TypeRef node to
indicate exactly how List is specialized. What is the way to get the
specialization type when it is not a class?


Vinay Sajip