From: Daniel Jacobowitz <drow@false.org>
To: Aleksandar Ristovski <ARistovski@qnx.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] fix for c++/2416
Date: Tue, 01 Apr 2008 17:06:00 -0000 [thread overview]
Message-ID: <20080401155347.GA20960@caradoc.them.org> (raw)
In-Reply-To: <47F255CC.4000704@qnx.com>
On Tue, Apr 01, 2008 at 11:33:32AM -0400, Aleksandar Ristovski wrote:
> I believe we should.
>
> Here is a dummy c++ program where this is done explicitly:
>
> #include <iostream>
> using namespace std;
> int main ()
> {
> int a = 42;
> int &refa = (int &)a; // cast not needed, yet compiler doesn't complain.
> cout << refa << endl;
> return 0;
> }
I had to ask two C++ experts what this meant and let them argue about
it for a little while... it's even legal if a is a double. This is
*reinterpret_cast<int *>(&a), an lvalue of type int. That's not what
GDB will do with it, but it's close enough for now.
If you'll delete the extra blank line, the patch and testcases are OK.
Thanks for your patience.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-04-01 15:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 16:26 Aleksandar Ristovski
2008-04-01 17:06 ` Daniel Jacobowitz [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-04-01 18:10 Aleksandar Ristovski
2008-04-01 18:52 ` Daniel Jacobowitz
2008-03-31 19:01 Aleksandar Ristovski
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
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
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=20080401155347.GA20960@caradoc.them.org \
--to=drow@false.org \
--cc=ARistovski@qnx.com \
--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