[cfe-users] cfe-users Digest, Vol 85, Issue 8

Robert Ankeney via cfe-users cfe-users at lists.llvm.org
Thu Feb 20 16:08:03 PST 2020


David - thanks for your suggestions, but no luck here. I had hoped for
something like a isTemplateTypeParam() function in QualType, but no such
luck. In many cases, if I do a getCanonicalType().getAsString() I get a
"type-parameter-0-0" as a result. Though not always. I don't even always
see "Type" returned if I do a getUnqualifiedType().getAsString(). I had
hoped for a simple function call, as these template parameters seem like
generic types.

Robert

On Mon, Feb 17, 2020 at 11:58 AM via cfe-users <cfe-users at lists.llvm.org>
wrote:

> Send cfe-users mailing list submissions to
>         cfe-users at lists.llvm.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
> or, via email, send a message with subject or body 'help' to
>         cfe-users-request at lists.llvm.org
>
> You can reach the person managing the list at
>         cfe-users-owner at lists.llvm.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of cfe-users digest..."
>
>
> Today's Topics:
>
>    1. How to determine if variable is templated?
>       (Robert Ankeney via cfe-users)
>    2. Re: How to determine if variable is templated?
>       (David Blaikie via cfe-users)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 16 Feb 2020 17:43:19 -0800
> From: Robert Ankeney via cfe-users <cfe-users at lists.llvm.org>
> To: via cfe-users <cfe-users at lists.llvm.org>
> Subject: [cfe-users] How to determine if variable is templated?
> Message-ID:
>         <
> CAJL6GZpyLBNx8iYDxNzZSxOBNf5_JAegE+WVxDW233Cvo-TF1w at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Suppose I have some code like:
>
> template<typename Type>
> Type tVar;
> function(tVar);
>
> How can I determine that tVar is templated from the VarDecl or a
> MemberExpr? I don't see any obvious function in QualType or Type.
>
> Thanks,
> Robert
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.llvm.org/pipermail/cfe-users/attachments/20200216/2a886f3a/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Mon, 17 Feb 2020 09:28:51 -0800
> From: David Blaikie via cfe-users <cfe-users at lists.llvm.org>
> To: Robert Ankeney <rrankene at gmail.com>
> Cc: via cfe-users <cfe-users at lists.llvm.org>
> Subject: Re: [cfe-users] How to determine if variable is templated?
> Message-ID:
>         <
> CAENS6Evh8eyvO+h4eZJU8GKdkXOXj7UzKT8BjYtY+2inhkD2QA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Guessing these sort of functions would be relevant:
>
> https://clang.llvm.org/doxygen/classclang_1_1VarDecl.html#a617bcdd5baaab0ccba71a96cd9c2ed03
>
> On Sun, Feb 16, 2020 at 5:43 PM Robert Ankeney via cfe-users <
> cfe-users at lists.llvm.org> wrote:
>
> > Suppose I have some code like:
> >
> > template<typename Type>
> > Type tVar;
> > function(tVar);
> >
> > How can I determine that tVar is templated from the VarDecl or a
> > MemberExpr? I don't see any obvious function in QualType or Type.
> >
> > Thanks,
> > Robert
> >
> > _______________________________________________
> > 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/20200217/fda6a48f/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
>
> ------------------------------
>
> End of cfe-users Digest, Vol 85, Issue 8
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20200220/e2d07030/attachment.html>


More information about the cfe-users mailing list