public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Joe Buck <jbuck@Synopsys.COM>
Cc: espie@quatramaran.ens.fr (Marc Espie), egcs@egcs.cygnus.com
Subject: Re: glossary for egcs - request for contributions
Date: Thu, 29 Apr 1999 00:12:00 -0000	[thread overview]
Message-ID: <or1zh3sxwk.fsf@lua.lbi.dcc.unicamp.br> (raw)
In-Reply-To: <199904290648.XAA11732@atrus.synopsys.com>

On Apr 29, 1999, Joe Buck <jbuck@Synopsys.COM> wrote:

> one may replace a class by a derived class.  e.g. I can overload a virtual
                                                              ^^^^
make that override

> 	typedef int (*PFDerived)(Derived&);
> 	int bfunc(Base&);
> 	PFDerived p = &bfunc;

> this is legal

No way!  :-)

You can't touch types of arguments when casting function types.  This
mechanism only works for pointers-to-members:

struct Base { void foo(); };
struct Derived : Base {};
typedef void (Derived::*PFDerived)();
PFDerived pD = &Base::foo;

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists

WARNING: multiple messages have this Message-ID
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Joe Buck <jbuck@Synopsys.COM>
Cc: espie@quatramaran.ens.fr (Marc Espie), egcs@egcs.cygnus.com
Subject: Re: glossary for egcs - request for contributions
Date: Fri, 30 Apr 1999 23:15:00 -0000	[thread overview]
Message-ID: <or1zh3sxwk.fsf@lua.lbi.dcc.unicamp.br> (raw)
Message-ID: <19990430231500.pTL0pUr3EeFK4rrpkHGTXygOp5qQnCapApTjll2TwuU@z> (raw)
In-Reply-To: <199904290648.XAA11732@atrus.synopsys.com>

On Apr 29, 1999, Joe Buck <jbuck@Synopsys.COM> wrote:

> one may replace a class by a derived class.  e.g. I can overload a virtual
                                                              ^^^^
make that override

> 	typedef int (*PFDerived)(Derived&);
> 	int bfunc(Base&);
> 	PFDerived p = &bfunc;

> this is legal

No way!  :-)

You can't touch types of arguments when casting function types.  This
mechanism only works for pointers-to-members:

struct Base { void foo(); };
struct Derived : Base {};
typedef void (Derived::*PFDerived)();
PFDerived pD = &Base::foo;

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists

  reply	other threads:[~1999-04-29  0:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-27 15:24 Philipp Thomas
1999-04-27 22:16 ` Jeffrey A Law
1999-04-28 10:01   ` Theodore Papadopoulo
1999-04-30 23:15     ` Theodore Papadopoulo
1999-04-30 23:15   ` Jeffrey A Law
1999-04-27 23:35 ` Martin v. Loewis
1999-04-28  0:08   ` Joe Buck
1999-04-28  9:46     ` Marc Espie
1999-04-28 23:48       ` Joe Buck
1999-04-29  0:12         ` Alexandre Oliva [this message]
1999-04-29  3:26           ` Joe Buck
1999-04-29  3:41             ` Alexandre Oliva
1999-04-30 23:15               ` Alexandre Oliva
1999-04-29 21:44             ` Jason Merrill
1999-04-30 23:15               ` Jason Merrill
1999-04-30 23:15             ` Joe Buck
1999-04-30 23:15           ` Alexandre Oliva
1999-04-29  0:21         ` Jason Merrill
1999-04-30 23:15           ` Jason Merrill
1999-04-30 23:15         ` Joe Buck
1999-04-30 23:15       ` Marc Espie
1999-04-30 23:15     ` Joe Buck
1999-04-30 23:15   ` Martin v. Loewis
1999-04-30 23:15 ` Philipp Thomas

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=or1zh3sxwk.fsf@lua.lbi.dcc.unicamp.br \
    --to=oliva@dcc.unicamp.br \
    --cc=egcs@egcs.cygnus.com \
    --cc=espie@quatramaran.ens.fr \
    --cc=jbuck@Synopsys.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).