------- Comment #9 from dodji at gcc dot gnu dot org 2008-09-11 07:56 ------- @Jakub:
* I think (x ? c.i : c.j) = y; should be valid. because we then fall into the item 4 of the spec, PDF page 115, section 5.16: Conditional operator which reads: "If the second and third operands are lvalues and have the same type, the result is of that type and is an lvalue" * (x ? c.i : a) = y; should not be valid because we fall into the item 5 that says: "Otherwise, the result is an rvalue". Then we fall into item 6: "Lvalue-to-rvalue (4.1), array-to-pointer (4.2), and function-to-pointer (4.3) standard conversions are performed on the second and third operands. After those conversions, one of the following shall hold: The second and third operands have the same type; the result is of that type. " So after this point, the result is an rvalue. So the assignation becomes invalid. * (x ? c.i : c.k) = y; Should be invalid as well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37146