In comp.compilers Zoltan Kocsi <zoltan@bendor.com.au> wrote:: mrs@kithrup.com (Mike Stump) writes:
[...]:> Let me quote from ANSI C++::>:> 5.17 Assignment operators [expr.ass]:>:> 1 There are several assignment operators, all of which group right-to-:> left. All require a modifiable lvalue as their left operand, and the:> type of an assignment expression is that of its left operand.

: So far it is simple and clear.

:> The:> result of the assignment operation is the value stored in the left:> operand after the assignment has taken place; the result is an lvalue.

: As you have stated, it says that the result is an lvalue, therefore it: must be a reference to the left hand storage rather than its content: directly.

As I said in my previous post, the above is not true in Standard
C++. It is subject to interpretation, but if the C++ committee meant
for the result to always be a reference to the left hand storage they
would have said so. They didn't and there is a fair bit of agreement
that if the compiler had to generate a temporary to do the assigment
then that temporary can be returned as the lvalue. (There is less
agreement about what happenes if no temporary is generated, but the
language is pretty clear that the compiler just has to guarantee you
get *some* lvalue that has the right type and the right value.)

As to the rest of Zoltan's post, its not clear that the difference
between C89/C9X and Standard C++ is properly appreciated. Assignment
behaves somewhat differently in the two languages as in C++ the result
of an assignment is an lvalue and in C it is not.

-Z-
[Followups to comp.std.c or comp.std.c++ please, this has wandered off
the topic of compiler construction. -John]