From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2539 invoked by alias); 27 Feb 2008 19:36:13 -0000 Received: (qmail 2530 invoked by uid 22791); 27 Feb 2008 19:36:12 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Feb 2008 19:35:49 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BD5F498140; Wed, 27 Feb 2008 19:35:47 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 9FC4A9811F; Wed, 27 Feb 2008 19:35:47 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JUS4A-0003EU-D1; Wed, 27 Feb 2008 14:35:46 -0500 Date: Wed, 27 Feb 2008 19:47:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb-patches@sourceware.org Subject: Re: [patch] fix for c++/2416 Message-ID: <20080227193546.GA11796@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb-patches@sourceware.org References: <47C5A5EE.6070107@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47C5A5EE.6070107@qnx.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00444.txt.bz2 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