From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5230 invoked by alias); 22 Nov 2004 21:45:25 -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 4667 invoked from network); 22 Nov 2004 21:45:15 -0000 Received: from unknown (HELO mail-out4.apple.com) (17.254.13.23) by sourceware.org with SMTP; 22 Nov 2004 21:45:15 -0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id iAMLq3Bb014019 for ; Mon, 22 Nov 2004 13:52:03 -0800 (PST) Received: from relay4.apple.com (relay4.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.14) with ESMTP id ; Mon, 22 Nov 2004 13:45:14 -0800 Received: from [17.201.24.249] (isolde.apple.com [17.201.24.249]) by relay4.apple.com (8.12.11/8.12.11) with ESMTP id iAMLjBJw020575; Mon, 22 Nov 2004 13:45:12 -0800 (PST) In-Reply-To: <20041122133935.A19882@synopsys.com> 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> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: Steve Naroff , gcc mailing list , Michael Matz , Ziemowit Laski , Andrew Pinski , Mike Stump From: Matt Austern Subject: Re: generalized lvalues -- patch outline Date: Mon, 22 Nov 2004 22:12:00 -0000 To: Joe Buck X-SW-Source: 2004-11/txt/msg00763.txt.bz2 On Nov 22, 2004, at 1:39 PM, Joe Buck wrote: > On Mon, Nov 22, 2004 at 01:23:22PM -0800, Matt Austern wrote: >> Unfortunately, there is another reason for allowing some tamed version >> of assignment to casts: compatibility with other compilers. Microsoft >> and CodeWarrior both allow this in one form or another. (Microsoft >> for >> C only, CodeWarrior for C++ as well. CodeWarrior only allows some >> limited forms of assignments to casts, and doesn't treat a cast as a >> true lvalue, so they still get overload resolution right.) > > Does CodeWarrior document the semantics of their extension? I'm trying to find that out. It's taking me a while, I'm afraid, partly because I'm not all that familiar with their documentation. I agree that's an important question. Another important question that I don't know the answer to: are there other compilers that accept some form of this extension? I wouldn't be surprised; lots of people have MS-compatibility modes. 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&. --Matt