<br>It seems the AST generated by libclang is missing nodes in some cases.  Example:<br><br>The AST for the program:<br><br>struct A {<br>   void foo() {};<br>};<br><br>template <class T><br>struct B {<br>   void bar();<br>
   A m_a;<br>};<br><br>template <class T><br>void B<T>::bar()<br>{<br>   m_a.foo();<br>}<br><br>contains a CALL_EXPR node for the symbol foo, just as I expect:<br><br>% ./c-index-test -test-print-typekind test6.cxx > out<br>
% grep foo out<br>CXXMethod=foo:3:9 (Definition) typekind=FunctionProto [result=Void] [isPOD=0]<br>CallExpr=foo:3:9 typekind=Dependent [isPOD=1]<br>MemberRefExpr=foo:3:9 SingleRefName=[15:8 - 15:11] RefName=[15:8 - 15:11] typekind=Unexposed [isPOD=1]<br>
<br>However, the program:<br><br>template <class T><br>struct A {<br>   void foo() {};<br>};<br><br>template <class T><br>struct B {<br>   void bar();<br>   A<T> m_a;<br>};<br><br>template <class T><br>
void B<T>::bar()<br>{<br>   m_a.foo();<br>}<br><br>where A is now a class template, does NOT contain such a node.  The only node referencing foo is the declaration:<br><br>% ./c-index-test -test-print-typekind test5.cxx > out<br>
% grep foo out<br>CXXMethod=foo:4:9 (Definition) typekind=FunctionProto [result=Void] [isPOD=0]<br><br>Can someone explain this?  Is this a bug?  How can I discover the "uses" of foo in this program if none of the nodes in the AST have that spelling?<br>
<br>Thanks,<br>Bob Anderson<br><br>