This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7828: g++ 3.3: bad non-lvalue error (non_cast_lvalue_or_else)


The following reply was made to PR c++/7828; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
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.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]