|m68k gcc/egcs question firstname.lastname@example.org (Zoltan Kocsi) (1999-09-20)|
|Re: m68k gcc/egcs question email@example.com (David Williams) (1999-09-24)|
|Re: m68k gcc/egcs question firstname.lastname@example.org (1999-09-24)|
|Re: m68k gcc/egcs question email@example.com (James Jones) (1999-09-27)|
|Re: m68k gcc/egcs question firstname.lastname@example.org (1999-09-28)|
|Re: m68k gcc/egcs question email@example.com (Zalman Stern) (1999-10-01)|
|Re: m68k gcc/egcs question firstname.lastname@example.org (Zoltan Kocsi) (1999-10-01)|
|Re: m68k gcc/egcs question email@example.com (Zalman Stern) (1999-10-03)|
|Re: m68k gcc/egcs question firstname.lastname@example.org (Graham Murray) (1999-10-03)|
|From:||Zalman Stern <email@example.com>|
|Date:||3 Oct 1999 03:28:15 -0400|
|References:||99-09-078 99-09-103 99-10-005|
In comp.compilers Zoltan Kocsi <firstname.lastname@example.org> wrote:
: email@example.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.
:> 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
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.
[Followups to comp.std.c or comp.std.c++ please, this has wandered off
the topic of compiler construction. -John]
Return to the
Search the comp.compilers archives again.