[cfe-dev] How to determine if TemplateTypeParmType is template specialization argument?

Manuel Klimek klimek at google.com
Tue Oct 16 12:58:17 PDT 2012


On Tue, Oct 16, 2012 at 9:45 PM, Konstantin Tokarev <annulen at yandex.ru>wrote:

> Hi all,
>
> I'd like to distinguish T in contexts (1) and (2):
>
> template<typename T>
> class B<T, int>                    // 1
> {
> public:
>     static void hello() {}
>     T t;                                  // 2
>     int t2;
> };
>
> Currently I implement VisitTemplateTypeParmTypeLoc in RecursiveASTVisitor,
> but it visits both 1 and 2, and I need to skip usages of T in contexts like
> (1).
>

To capture the context, you can implement your own Traverse*() method that
calls to the original; then you know when a visitation was "inside" another
visitation.

Cheers,
/Manuel


>
> --
> Regards,
> Konstantin
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121016/53df3e90/attachment.html>


More information about the cfe-dev mailing list