This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] fix for c++/2416
- From: Daniel Jacobowitz <drow at false dot org>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 27 Feb 2008 14:35:46 -0500
- Subject: Re: [patch] fix for c++/2416
- References: <47C5A5EE.6070107@qnx.com>
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.
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?
--
Daniel Jacobowitz
CodeSourcery