[cfe-commits] [Patch][Review request] RecursiveASTVisitor can now traverse template specializations

Benoit Belley Benoit.Belley at autodesk.com
Wed Sep 1 13:15:15 PDT 2010


Hi John,

Le 2010-09-01 à 15:59, John McCall a écrit :

> No, I mean something like this:
>  template <class T> struct A { T foo; };
>  int bar(A<T> &a) { return 0; }
> i.e. where a specialization of A was used but not required to be a complete type and so template instantiation was never done.

I have just tested my proposed change with :

--------------------------
template <class T> struct A {
    void hoo() {}
    T foo;
};

template <class T>
int bar(A<T> &a) { return 0; }

int goo(A<int> &a) { return 0; }
----------------------------
 
and the template A<int> is indeed never instantiated and the RecursiveASTVisitor behave correctly in this case also.

Benoit
 
Benoit Belley
Sr Principal Developer
M&E-Product Development Group    
 
Autodesk Canada Inc. 
10 Rue Duke
Montreal, Quebec  H3C 2L7 
Canada
 
Direct 514 954-7154
 
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 651 bytes
Desc: image002.gif
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100901/98d091da/attachment.gif>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001..txt
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100901/98d091da/attachment.txt>


More information about the cfe-commits mailing list