This is the mail archive of the gcc-bugs@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)


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


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