RecursiveASTVisitor and template instantiations

Hi Everyone,

I am trying to write a custom static analyzer check for Clang. In my checker, I need to traverse all of the template instantiations because I need to know how function calls made by template instantiations are actually resolved.

I am using the RecursiveASTVisitor to achieve this. Unfortunately, the RecursiveASTVisitor does not traverse template instantiations by default and I had to customize it. I was able to achieve this customization all in my derived class, with the exception of redeclaring RecursiveASTVisitor::TraverseCXXRecordHelper() protected instead of private. Please look below for the code.

I am wondering if :

   a) Clang has another visitor better suited for what I am trying to achieve, or if

   b) it would be a good idea to augment the RecursiveASTVisitor class to optionally visit the template instantiations.

I am willing to submit a patch for option b) if others also agree that this would a useful improvement.

Thanks for your help,


ATT00001…txt (7 Bytes)