This is the mail archive of the gcc@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: generalized lvalues -- patch outline


On 22 Nov 2004, at 13.01, Nathan Sidwell wrote:

Ziemowit Laski wrote:
Indeed, I now appear to have a mainline mod for C and C++ which allows assignment to lvalue casts for pointer types. What follows is a high-level synopsis of what I did; if there is interest, I can whip up a full-fledged patch, complete with docs. Please let me know.

Please describe the semantics *in detail* of what you are trying to achieve. Why are the modify-assignment operators not allowed? That appears non-orthogonal.

Modify-assignment is (or should be; I'll check) allowed.


The semantics are that a C-style cast of an lvalue will itself be treated as an lvalue under the following circumstances:
- The lvalue cast does not induce a type conversion (if it does, then we use the type conversion instead);
- The lvalue cast is being assigned to, incremented or decremented;
- The lvalue is of a pointer type, and is being cast to a pointer type. (This will need to be relaxed somewhat should people desire Microsoft compatibility, at least for C.)


Of course, all of this only with the -flvalue-cast-assign flag specified.

--Zem


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