Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Chastain <mec.gnu@mindspring.com>
To: cagney@gnu.org
Cc: gdb@sources.redhat.com, david.carlton@sun.com, carlton@bactrian.org
Subject: Re: new testsuite function for c++ ptype
Date: Wed, 04 Aug 2004 04:36:00 -0000	[thread overview]
Message-ID: <4110679B.nailCV23CXHLM@mindspring.com> (raw)
In-Reply-To: <410FE479.1020104@gnu.org>

Andrew Cagney <cagney@gnu.org> wrote:
ac> 	{
ac> 	  { field private "int a;" }
ac> 	  { method public "virtual int f();" }
ac> 	}

That's a great idea!

I like the flat 3-tuples a bit better than the more nested "field {
private "int a;" }" form.  Then I can do:

  {
    { vbptr private "A" }
    { field private "int a;" }
    { method public "virtual int f();" }
  }

This is much more flexible for the future.  And it cuts down on the
required backslashes, too.

ac> - I don't undersand why "V" appears twice in:
ac>  >     "class" "VA" { "public virtual V" } \
ac>  >     { "V" } \
ac> I guess I'm really asking if "V" can be extracted from "public virtual V"

Almost, but it won't actually work.  The problem is indirect base classes:

    cp_test_ptype_class "ptype pBe" "ptype pBe" \
        "class" "B" { "public A" } \
	{
	  { vbptr private "V" }
	  { field private "int a;" }
	  { method public "virtual int f(); }
	} \
	*

I could say: all the direct virtual base classes are automatically
entered in the vbptr list, so the caller only has to list the
indirect virtual base classes.  I'm dubious about that, because
it's more complicated than just "list all the vbptrs that pop up".

Michael C


      reply	other threads:[~2004-08-04  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-03 14:09 Michael Chastain
2004-08-03 19:16 ` Andrew Cagney
2004-08-04  4:36   ` Michael Chastain [this message]

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=4110679B.nailCV23CXHLM@mindspring.com \
    --to=mec.gnu@mindspring.com \
    --cc=cagney@gnu.org \
    --cc=carlton@bactrian.org \
    --cc=david.carlton@sun.com \
    --cc=gdb@sources.redhat.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