From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30531 invoked by alias); 19 Nov 2004 21:39:50 -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 30113 invoked from network); 19 Nov 2004 21:39:42 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org with SMTP; 19 Nov 2004 21:39:42 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id iAJLjntU009483 for ; Fri, 19 Nov 2004 13:45:49 -0800 (PST) Received: from relay4.apple.com (relay4.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.14) with ESMTP id ; Fri, 19 Nov 2004 13:40:21 -0800 Received: from [17.201.24.57] (polskifiat.apple.com [17.201.24.57]) by relay4.apple.com (8.12.11/8.12.11) with ESMTP id iAJLdND8029143; Fri, 19 Nov 2004 13:39:24 -0800 (PST) In-Reply-To: <419DE946.2090705@codesourcery.com> References: <8AD5AEEF-3914-11D9-8BD2-000A95BCF344@apple.com> <852F83A5-39B9-11D9-8317-00039390FFE2@apple.com> <87zn1eiuy4.fsf@codesourcery.com> <39B69E96-39C9-11D9-8317-00039390FFE2@apple.com> <419DE946.2090705@codesourcery.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <57DF36FA-3A73-11D9-9070-000D9330C50E@apple.com> Content-Transfer-Encoding: 7bit Cc: Matt Austern , Joe Buck , Zack Weinberg , gcc mailing list From: Ziemowit Laski Subject: Re: generalized lvalues Date: Fri, 19 Nov 2004 21:58:00 -0000 To: Nathan Sidwell X-SW-Source: 2004-11/txt/msg00699.txt.bz2 On 19 Nov 2004, at 4.38, Nathan Sidwell wrote: > > Do you need a solution that works in both C and C++? Yes. > > If you're adding language extensions, you should choose one that is the > smallest possible extension (ideally, it would be 'not-an-extension'). > The cast-as-lvalue idea fails for C++, as Joe Buck has pointed out, and > it fails for C as it makes a whole swathe of ill-formed uses now > well-formed, > but with non-intuitive semantics. Yes, Joe raised a very good point, although it made me realize that I'm not really after the whole casts-as-lvalues enchilada, but really after the ability to be assign to a cast. I believe the compiler will currently complain about assigning to a non-lvalue, and what I'd need is some sort of -fassign-to-cast flag (off by default, but on for ObjC/ObjC++) that would let it go through. Of course, the compiler should only allow the assignment if the cast does _not_ result in a temporary being created. --Zem