<div dir="ltr">Hi,<div><br></div><div>Is anyone able to help me figure out how to ensure ClassTemplateSpecializationDecls always have definitions so that I can properly inspect there members with the appropriate type substitutions? I am visiting template instantiations via ```shouldVisitTemplateInstantiations() { return true; }```, but I'm finding that they do not always have a definition attached to them.</div><div><br></div><div>I'm porting a code generation tool from the python clang bindings to C++ using ClangTool and RecursiveASTVisitor. My tool generates lua bindings from C++ source code. It needs to generate bindings for template instantiations, and requires knowledge of the template arguments in order to do so.<br></div><div><br></div><div>This code will result in a ClassTemplateSpecializationDecl that is missing its definition (hasDefinition() == false):</div><div><br></div><div>```</div><div><div>  template<typename T></div><div>  class Bar {</div><div>  public:</div><div>    T m_t;</div><div>  };</div><div>  using BarInt = Bar<int>;</div></div><div>```</div><div><br></div><div>Whereas this code will result in hasDefinition() == true as I want:</div><div>```</div><div><div>  class Foo : public Bar<int> {};</div></div><div>```</div><div><br></div><div>Thanks for any help you can provide! I've searched the net for answers, and also browsed the clang source code, but I'll admit that I haven't dug deeply enough yet to figure out exactly which code path is triggering the instantiations that are missing definitions yet.</div><div><br></div><div>Thanks,</div><div>Kris</div></div>