3 msgtgmath.h and newlib
2 msgHow to force instruction in slot1 while emit NO...
5 msgAST-tree in GCC
2 msggcc crosscompile for PPC, Please help!
1 msgRegister Allocation Reviewers
1 msgCambio de direccion.
5 msghow to chase a tree check failure in verify_ssa?
6 msgsupport single predicate set instructions in GC...
1 msggcc-4.3-20070921 is now available
25 msg[RFC] failures found while pounding on GCC trunk
1 msgBootstrap comparison failure on sparc64/sparc l...
2 msgUnderstanding Macro Pre-processor
3 msgfunction overloading and variadic arguments
4 msgg++ 4.3.0 error: changes meaning

Bug in gcc: assignment to non-lvalue
\ Michiel de Bondt (20 Sep 2007)
. \ Andrew Pinski (20 Sep 2007)
. . \ Michiel de Bondt (20 Sep 2007)
. . . \ Aaron W. LaFramboise (21 Sep 2007)
. . . \ Jonathan Wakely (22 Sep 2007)
. . . . \ Jonathan Adamczewski (24 Sep 2007)
. . . . . \ Jonathan Wakely (24 Sep 2007)

3 msgInconsistent error/pedwarn: ISO C++
4 msgGCC spec posting on AMD Barcelona
1 msgRe: [Bug c/33076] Warning when passing a pointe...
1 msgpowerpc bootstrap failure
12 msgMIPS atomic memory operations (A.K.A PR 33479).
Subject:Re: Bug in gcc: assignment to non-lvalue
Group:Gcc
From:Jonathan Wakely
Date:24 Sep 2007


On 24/09/2007, Jonathan Adamczewski <jadamcze> wrote:
>
> What about something like the following?
>
> struct proxy {
> T& t;
> proxy(T& t_) : t(t_) {}
> proxy& operator=(const T& r) { foo(t, r); return *this; }
> };
>
> struct B { proxy get() { return proxy(bar); } };
>
> int main ()
> {
> B b;
> b.get() = 0;
> }

That is legal, 3.10 paragraph 10 says:
An lvalue for an object is necessary in order to modify the object
except that an rvalue of class type can also be used to modify its
referent under certain circumstances. [Example: a member function
called for an object (9.3) can modify the object. ]

The example I posted doesn't use any member functions, but it's not
clear what other circumstances allow it. I'm pretty sure assigning to
rvalues of builtin type shouldn't compile though.

Jon


© 2004-2008 readlist.com