[cfe-users] Getting underlying type for `using typename` declaration

Richard Smith via cfe-users cfe-users at lists.llvm.org
Mon Jul 22 12:38:00 PDT 2019


On Wed, 17 Jul 2019 at 23:20, Victor “LOST” Milovanov via cfe-users <
cfe-users at lists.llvm.org> wrote:

> Hi CFE users!
>
>
>
> I am trying to get a `QualType` instance from
> `UnresolvedUsingTypenameDecl`. Unlike `TypeAliasDecl`
> `UnresolvedUsingTypenameDecl` does not have a `getUnderlyingType` method.
>
>
>
> I could not find a way to construct one from the `DeclarationNameInfo`
> (`getNameInfo`) and `NestedNameSpecifier` (`getQualifier`).
>

You could build a suitable QualType by calling
Sema::CheckTypenameType(ETK_Typename, U->getTypenameLoc(),
U->getQualifierLoc(), U->getIdentifier(), U->getLocation()).


> The library I am working on already supports type aliases, and I was
> hoping I could treat `using typename` declarations in a similar way. Not
> sure if it is the right way though.
>
>
>
> Regards,
>
> Victor
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20190722/4f3cdfe9/attachment.html>


More information about the cfe-users mailing list