From: Aleksandar Ristovski <aristovski@qnx.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] fix for c++/2416
Date: Wed, 27 Feb 2008 20:00:00 -0000 [thread overview]
Message-ID: <47C5BE84.7050803@qnx.com> (raw)
In-Reply-To: <20080227193546.GA11796@caradoc.them.org>
Daniel Jacobowitz wrote:
> On Wed, Feb 27, 2008 at 01:03:26PM -0500, Aleksandar Ristovski wrote:
>> Hello,
>>
>> As described in the bug report 2416, the problem is with casting to a
>> reference. The attached patch should fix this.
>
> /* You can't cast to a reference type. See value_cast_pointers
> instead. */
> gdb_assert (code1 != TYPE_CODE_REF);
>
> Is casting to a reference type useful, or should we have issued an
> error instead? C++ does not permit this.
Not sure what you mean by "C++ does not permit this"...
This is valid:
void testCast1 (IP::base & arg) {
IP::derived &ader = (IP::derived &)arg;
cout << "Test the casting\n";
ader.foo();
}
>
> The new error is incorrect, which does suggest some missing tests.
> You can cast from a reference type; value_cast follows references,
> so an int is just like an int &.
>
> Like Michael, I don't understand the value.c changes. Could you
> explain them?
>
I replied to that.
next prev parent reply other threads:[~2008-02-27 19:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-27 18:43 Aleksandar Ristovski
2008-02-27 19:30 ` Michael Snyder
2008-02-27 19:36 ` Aleksandar Ristovski
2008-02-27 19:47 ` Daniel Jacobowitz
2008-02-27 20:00 ` Aleksandar Ristovski [this message]
2008-02-27 20:09 ` Daniel Jacobowitz
2008-02-27 21:26 ` Aleksandar Ristovski
2008-02-27 23:50 ` Daniel Jacobowitz
2008-02-28 19:12 ` Aleksandar Ristovski
2008-02-28 19:39 ` Daniel Jacobowitz
2008-02-29 10:10 ` Aleksandar Ristovski
2008-03-04 19:39 ` Aleksandar Ristovski
2008-04-01 14:51 ` Daniel Jacobowitz
2008-02-29 2:44 ` Michael Snyder
2008-03-31 19:01 Aleksandar Ristovski
2008-04-01 16:26 Aleksandar Ristovski
2008-04-01 17:06 ` Daniel Jacobowitz
2008-04-01 18:10 Aleksandar Ristovski
2008-04-01 18:52 ` Daniel Jacobowitz
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=47C5BE84.7050803@qnx.com \
--to=aristovski@qnx.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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