Created on 2003-06-15.00:00:00 last changed 196 months ago
[Voted into WP at March 2004 meeting.]
Proposed Resolution (October 2003):
Change the second bullet of 7.6.1.5 [expr.ref] paragraph 4 to read:
If E1 is an lvalue, then E1.E2 is an lvalue; otherwise, it is an rvalue.
Notes from October 2003 meeting:
We agree the reference should be an rvalue, and a change along the lines of that recommended by Mike Miller is reasonable.
Consider
typedef struct { int a; } A; A f(void) { A a; return a; } int main(void) { int* p = &f().a; // #1 }
Should #1 be rejected? The standard is currently silent.
Mike Miller: I don't believe the Standard is silent on this. I will agree that the wording of 7.6.1.5 [expr.ref] bullet 4.2 is unfortunate, as it is subject to misinterpretation. It reads,
If E1 is an lvalue, then E1.E2 is an lvalue.The intent is, "and not otherwise."
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2004-04-09 00:00:00 | admin | set | messages: + msg1006 |
2004-04-09 00:00:00 | admin | set | status: ready -> wp |
2003-11-15 00:00:00 | admin | set | messages: + msg911 |
2003-11-15 00:00:00 | admin | set | messages: + msg910 |
2003-11-15 00:00:00 | admin | set | status: open -> ready |
2003-06-15 00:00:00 | admin | create |