Clang AST: find constructor body and all of its declarations

0

I have the following source code:

1 class a {
2    private:
3        int x;
4    public:
5        a(int);
6 };
7
8 a::a(int b) {
9     x = b;
10  };
11 
12  int main (void) {
13     a instance = a(3); 
14     // call to a(3) points to declaration a(int) 
15     // in the body of class, not to the actual 
16     // definition via a::a(...)
17 }

I want to find which class constructors were actually used in the source code. I use lib tooling for that task. I find all the call sites as:

cxxConstructExpr(hasAncestor(declStmt()))

Which finds the CXXConstructExpr of a call to a(3). However, when I call getConstructor() on the instance of CXXConstructExpr I get a pointer of the constructor definition in line 5, and not to the actual implementation in line 8.

How do I recover the relationship between 8 and 5?