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

Konstantin Tokarev annulen at yandex.ru
Wed Oct 17 03:35:50 PDT 2012


16.10.2012, 23:58, "Manuel Klimek" <klimek at google.com>:
> 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.

Thank you very much!

-- 
Regards,
Konstantin



More information about the cfe-dev mailing list