This is the mail archive of the gcc-patches@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]

Re: (C++) fix instantiation of typename types


>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:

  BTW, it seems odd that a TEMPLATE_TEMPLATE_PARM is considered a type.
  But I'll leave that for another time.

The hokey thing is that when a TEMPLATE_TEMPLATE_PARM is instantiated
with some arguments (in a template declaration, like:

  template <template <class T> class D, class E>
  class F {
    D<E> de;
  }

then the D<E> thing is a TEMPLATE_TEMPLATE_PARM with TEMPLATE_INFO.
So, TEMPLATE_TEMPLATE_PARMs can be either parameters, or stand-ins for
actualy types.

I think this is a weird design.  I don't remember which of us reviewed
the patches for this stuff, but I don't remember noticing this in any
case.  I think the instantiations should actually be RECORD_TYPEs,
probably.  But, that's why things are the way they are, I think.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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