Location of a TypeAliasDecl from a TemplateSpecializationType

Is it possible to retrieve the location of a TypeAliasDecl from a
TemplateSpecializationType representing an alias template?

It looks like the connection between the type and the original decl is
lost during construction - I guess it could/should be persisted? (in a
manner similar to TypedefType, for example)

I don't need the alias template to have specializations like a real
template, so the decl that the TemplateSpecializationType points to
can just be the TypeAliasDecl which is generic/defined in terms of
template arguments.

Specifically what I need is the location and the DeclContext where the
alias was written so I can accurately describe the alias in the debug
info.

Thanks,
- David

Is it possible to retrieve the location of a TypeAliasDecl from a
TemplateSpecializationType representing an alias template?

Something like:

cast<TypeAliasTemplateDecl>(TST->getTemplateName()->getTemplateDecl())->getTemplatedDecl()

(plus error checking).

It looks like the connection between the type and the original decl is

Is it possible to retrieve the location of a TypeAliasDecl from a
TemplateSpecializationType representing an alias template?

Something like:

cast<TypeAliasTemplateDecl>(TST->getTemplateName()->getTemplateDecl())->getTemplatedDecl()

Oh, thanks - didn't think to look inside the TemplateName for more
details... good to know.

Used to implement debug info for alias templates in 205691.

Is it possible to retrieve the location of a TypeAliasDecl from a
TemplateSpecializationType representing an alias template?

Something like:

cast<TypeAliasTemplateDecl>(TST->getTemplateName()->getTemplateDecl())->getTemplatedDecl()

Oh, thanks - didn't think to look inside the TemplateName for more
details... good to know.

Used to implement debug info for alias templates in 205691.

(plus error checking).

From what I could tell in the docs the error cases won

(fat-fingered premature send)

error cases won't apply to this code path since it's specifically only
for type alias templates.

I haven't looked at whether we need to produce any debug info for
function alias templates.