This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: template_decl's


I was told that my message looks like a mislead message about c++ programming at the first look, and I agree, so I'd like to point out that it's about the gcc _tree representation_ of templates, not about using templates.
sorry for the noise.


given this code:
template<typename OUTER> struct Outer{
    template<typename INNER> struct Inner{};
};
A<int>::Inner<double> var;

there are 2 template_decl nodes for "Inner", one in scope "Outer<OUTER>", and one in "Outer<int>".
the type of the template_decl in "Outer<int>" is only a declaration, no definition, and has no instantiations etc.


I need the general template decl of "var", but the type of var is the type of the declaration template_decl in "Outer<int>".
so how do you get the general one, not the one instantiated by Outer?


TI_TEMPLATE of the type brings you back to the instantiated one.
the only "link" I can see in pretty prints is from the field lists of Outer.


Thanks for your help,




-- Stefan Strasser


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]