From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14321 invoked by alias); 4 Sep 2002 19:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14307 invoked by uid 71); 4 Sep 2002 19:26:01 -0000 Date: Wed, 04 Sep 2002 12:26:00 -0000 Message-ID: <20020904192601.14306.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andrew Pinski Subject: Re: c++/7828: g++ 3.3: bad non-lvalue error (non_cast_lvalue_or_else) Reply-To: Andrew Pinski X-SW-Source: 2002-09/txt/msg00061.txt.bz2 List-Id: The following reply was made to PR c++/7828; it has been noted by GNATS. From: Andrew Pinski To: snyder@fnal.gov Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/7828: g++ 3.3: bad non-lvalue error (non_cast_lvalue_or_else) Date: Wed, 4 Sep 2002 15:21:32 -0400 One question which libstdc++, because the version 3 is fine and it compiles just fine with this patch? Another point, it is invalid code, the problem is that the casting does makes a variable not a lvalue. gcc was accepting the invalid code because no one wanted to fix it until Matt Austern did. The error message is because when you pass an argument into a function and that argument is a reference, gcc tries to use the unary `&', which means take the memory location that points to that lvalue. Thanks, Andrew Pinski PS Also it is not illegal code but invalid code.