template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
+or
+ template <typename T> class X {}; class A {}; extern template class X<A>;
cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.
template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
+or
+ template <typename T> class X {}; class A {}; extern template class X<A>;
cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.
template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
+or
+ template <typename T> class X {}; class A {}; extern template class X<A>;
cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.