[cfe-dev] Typedef templates

Lin, Alexander S. (JSC-ER711) alexander.s.lin at nasa.gov
Thu Jun 21 08:32:55 PDT 2012

I forgot to mention that I have gotten as far as writing a RecursiveASTVisitor and have found the TemplateSpecilizationType node where I can get both the original template and the argument list.  I just don’t know how to put them together.



On 6/21/12 10:23 AM, "Alex Lin" <alexander.s.lin at nasa.gov> wrote:

Hello everyone,

I’m new to clang and this is my first post, so please forgive me for what may be a basic question.

I have a template like this:

template <class T, class U, class V>
class MyTemplate {
    T var1 ;
    U var2 ;
    V var3 ;
} ;

And I have a typedef like this:

typedef MyTemplate< double , int , short > MyTemplateTypedef ;

What I’m trying to find is somewhere that stores the template with the arguments substituted in.  I have seen some of the template instantiating routines in Sema, but cannot figure out how to use them.  Am I on the right track here?

Thanks in advance,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120621/e2b10c93/attachment.html>

More information about the cfe-dev mailing list