public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
To: egcs@cygnus.com
Subject: Template template parameter patch
Date: Fri, 16 Jan 1998 01:51:00 -0000	[thread overview]
Message-ID: <34BE42E8.2994@scf.usc.edu> (raw)

[This is my 3rd attempt to post this mail.  Sorry if you receive
duplicate post.]

Hi,

I finished an implementation of template template parameter for egcs. 
The patch and ChangeLog is in the file
	egcs-971225-ttp980113.patch
at
	http://www-scf.usc.edu/~lerdsuwa/util/patch/

The patch is against egcs-971225.  It passes the regression test.  Only
2 new test cases (ttp22.C and ttp23.C) fails.  I will post a fix to
these 2 cases as a separate patch since it has nothing to do with
template template parameter - template name D being introduced in
derived class scope as D<int>.

Implementataion details:

The design involves a new TEMPLATE_TEMPLATE_PARM node.  It is similar to
TEMPLATE_TYPE_PARM except that its TYPE_NAME is a TEMPLATE_DECL and its
template arguments, if present, are kept inside the
CLASSTYPE_TEMPLATE_INFO field.

In template argument substitution, a TEMPLATE_TEMPLATE_PARM with
template arguments (which appears as a type like TT<int> where TT is a
template parameter) is turned into a RECORD_TYPE while the one without
template arguments (one that is part of template signature like  int
f<TT>() ) is turned into a TEMPLATE_DECL.

The character 'z' is used in name mangling.
If the template template parameter is used in a type, it is encoded as
zX?? (?? = template argument level and index).
If used as template argument in signature, the argument is encoded as
	z + <number of parameter> + <parameter list>
	  + <length of substituted template name>
	  + <subst. template name>

Enjoy!

Kriang

             reply	other threads:[~1998-01-16  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-16  1:51 Kriang Lerdsuwanakij [this message]
1998-01-16 14:37 Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34BE42E8.2994@scf.usc.edu \
    --to=lerdsuwa@scf-fs.usc.edu \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).