if (ClassTemplateSpecializationDecl const *const TemplateSpecialization
= Nodes.getNodeAs<ClassTemplateSpecializationDecl>("ts")) {
// obtain text of template specialization
}
I can find out if this is an explicit instantiation or specialization
and I can get the template arguments with getTemplateArgs(), but I
can't seem to find accessors for the source location around the
template argument.
It seems silly for me to have to scrape out the template argument from
the whole specialization with ad-hoc string searches. I'm thinking
there's a better way that I'm missing.
if (ClassTemplateSpecializationDecl const *const TemplateSpecialization
= Nodes.getNodeAs<ClassTemplateSpecializationDecl>("ts")) {
// obtain text of template specialization
}
I can find out if this is an explicit instantiation or specialization
and I can get the template arguments with getTemplateArgs(), but I
can't seem to find accessors for the source location around the
template argument.
It seems silly for me to have to scrape out the template argument from
the whole specialization with ad-hoc string searches. I'm thinking
there's a better way that I'm missing.
Suggestions?
Does
getTypeAsWritten()->getTypeLoc() give you a TemplateSpecializationTypeLoc?