This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question regarding C++ frontend
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "Peter Collingbourne" <pcc03 at doc dot ic dot ac dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 3 May 2008 08:29:25 -0400
- Subject: Re: Question regarding C++ frontend
- References: <20080502153915.GB15025@doc.ic.ac.uk>
On Fri, May 2, 2008 at 11:39 AM, Peter Collingbourne <pcc03@doc.ic.ac.uk> wrote:
> In the C++ frontend, record_types maintain list(s) of the parameters
> which were used to instantiate the type, one list for each "level" of
> the instantiation. I would like to know how to determine the list of
> parameters that were used to instantiate "this" type e.g. in the case of
> a type foo<int>::bar<long> I would like the tree_vec containing the type
> "long". Note that we can't always simply extract the last list of
> parameters e.g. for the type foo<int>::baz the tree_vec required would
> be empty or null whereas the tree_vec available has a single level for
> "int".
INNERMOST_TEMPLATE_ARGS can be used to get at the "innermost" TREE_VEC
of template arguments for a class template specialzation such as
foo<int>::bar<long>. CLASSTYPE_USE_TEMPLATE != 0 tells you whether a
RECORD_TYPE is actually a template
- Doug