Changes clang_visitChildren()'s behaviour to also visit all explicit and implicit class template instantiations upon visiting a ClassTemplateDecl. In analogy to clang++'s -dump-ast option, they are treated as children of the ClassTemplateDecl node.
This is done by
- adding the CXCursor_ClassTemplateSpecialization cursor kind,
- adding a EnforceVisitBody flag to CursorVisitor::VisitClassTemplateSpecializationDecl, which overrides the existing early exits in that method,
- and recursively descending into theTemplateDecl->specializations().
This patch also adds a query function clang_getTemplateSpecializationKind and the associated enum type CXTemplateSpecializationKind to retrieve the specialisation kind. That way, users can distinguish between implicit instantiations (which they probably want to visit as child of the ClassTemplateDecl) and explicit instantiation (which they may want choose to ignore, because their node will reappear at the very location where the explicit instantiation takes place).