From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26124 invoked by alias); 23 Nov 2004 00:03:52 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26086 invoked from network); 23 Nov 2004 00:03:43 -0000 Received: from unknown (HELO uniton.integrable-solutions.net) (62.212.99.186) by sourceware.org with SMTP; 23 Nov 2004 00:03:43 -0000 Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id iAN03RQ0014130; Tue, 23 Nov 2004 01:03:28 +0100 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id iAN03Rlx014129; Tue, 23 Nov 2004 01:03:27 +0100 X-Authentication-Warning: uniton.integrable-solutions.net: gdr set sender to gdr@integrable-solutions.net using -f To: Matt Austern Cc: Joe Buck , Steve Naroff , gcc mailing list , Michael Matz , Ziemowit Laski , Andrew Pinski , Mike Stump Subject: Re: generalized lvalues -- patch outline References: <98C86CD4-39E2-11D9-B2D5-000A95BCF344@apple.com> <20041119170011.A30410@synopsys.com> <9E6AD708-3A93-11D9-9070-000D9330C50E@apple.com> <20041119174042.A1311@synopsys.com> <90DC5074-3A96-11D9-9070-000D9330C50E@apple.com> <9CD04F70-3CC6-11D9-B847-000D9330C50E@apple.com> <7688EB08-3CC7-11D9-AEB4-000A95D692F4@physics.uc.edu> <20041122133935.A19882@synopsys.com> From: Gabriel Dos Reis In-Reply-To: Organization: Integrable Solutions Date: Tue, 23 Nov 2004 00:06:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-11/txt/msg00769.txt.bz2 Matt Austern writes: | One oddity I've found is that CW allows this: | int x; | int* p = x; | char c; | (char*) p = &c; | | but not this: | int x; | (char) x = 'a'; | | And, as I said, they do choose the correct overload when you pass | ((char*) p) to a function that's overloaded on char*& and char* | const&. I'm surprised that such efforts are being spent to resurect that abomination, when the C++ language already made clear provisions int x; int* p = x; char c; reinterpret_cast(p) = &c; or int x; reinterpret_cast(x) = 'a'; to mark those dubious constructs. I offer template inline void sheat(U& u, V v) { reinterpret_cast(u) = v; } as a free replacement of that abomination resurection. Please, let's keep this straight. It is already in the language; we do not need to overload existing syntax in a way that conflict with standard semantics. cast-as-lvalue must go. -- Gaby