This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7828: g++ 3.3: bad non-lvalue error (non_cast_lvalue_or_else)
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: snyder at fnal dot gov, gcc-gnats at gcc dot gnu dot org, pcarlini at unitus dot it, gcc-bugs at gcc dot gnu dot org, Matt Austern <austern at apple dot com>, Andrew Pinski<pinskia at physics dot uc dot edu>
- Cc: mark at codesourcery dot com
- Date: Mon, 09 Sep 2002 21:54:58 +0100
- Subject: Re: c++/7828: g++ 3.3: bad non-lvalue error (non_cast_lvalue_or_else)
- Organization: Codesourcery LLC
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7828
Paolo asked me to look at this and 7858.
<really short version>
Scott is usually right about c++
<short version>
Scott's code is well formed, g++ is wrong, Matt's patch probably broke it.
<long version>
long (x)
is an rvalue [5.2.3]/2
Foo (const long &)
can bind to an rvalue [5.2.2]/4, [8.5]/12, [8.5.3]/5 2nd major point
'Otherwise the reference shall be to a non-volatile const type' ...
'otherwise a temporary of type 'cv1 T1' is created ...'
Matt, as it appears that your patch has broken this, even though it might
have fixed some bug, could you either fix the latent bug, or revert your patch
(like the development plan specifies). It'd be neat to add a scott's code as
a g++ testcase too.
nathan