[cfe-dev] Location of a TypeAliasDecl from a TemplateSpecializationType

Richard Smith richard at metafoo.co.uk
Sun Apr 6 02:09:13 PDT 2014


On Sun, Apr 6, 2014 at 12:21 AM, David Blaikie <dblaikie at gmail.com> wrote:

> 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
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140406/9c6bc821/attachment.html>


More information about the cfe-dev mailing list