finding function callee declarations for type/value dependent function calls

Hi,

I would like to solve the following problem using clang:
I am traversing the AST using CompilerInstance/CompilerInvocation and try to
find function callees for function calls. This works well, as long as the
function call is not a type- or value-dependent CallExpr, for which the callee
resolves to an UnresolvedLookupExpr.

template<class T>
void foo(T a) {
  a++;
}

template<class T>
void bar() {
  T a;
  foo(a);
}

int main(int argc, char **argv) {
  bar<int>();
}

I am aware that template instantiation is neccessary to locate the correct
callees and that this is not possible AST-parsing setup, alone.
However, could you please give me any hints on how to solve this, i.e. how to
perform the template instantiation and resolve the instantiated templates to
their former counterparts in the original source code?

Thanks a lot,
Felix

Hi,

I would like to solve the following problem using clang:
I am traversing the AST using CompilerInstance/CompilerInvocation and try to
find function callees for function calls. This works well, as long as the
function call is not a type- or value-dependent CallExpr, for which the callee
resolves to an UnresolvedLookupExpr.

If you traverse the AST with RecursiveASTVisitor, it allows you to
traverse template instantiations.

Cheers,
/Manuel