In short, your example is also defined expression.
The following statement is my intention which is different from you.
update or read of `s.x` does not require reading the container object
's'
Anyway, I'd like answer your question as possible.
Now the question is: is that read access
considered a part of the side effect, or may it be considered a part of
value computation (as defined in 5.1.2.3)? If the latter, then the
behaviour is undefined.
I think read access is a part of value computation. It is well
specified
at 5.1.2.3p2("Accessing a volatile object, modifying an object,
modifying a file, or calling a function ... changes in the state of
the execution environment").
But value computation may involve side effect.
e.g), *(p + x++) = e // value computation of lvalue involves
// side effect of x.
In your example, that has also defined bevaiour not undefined.
s.x = (s.x++, u);
^^^(1) ^^^^^(2)
^^^^^^^^^^(3)
It is unsequenced between (1) and (3). Also unsequenced (1) and (2).
Numbering does not mean the order of evaluation.
value computation of (1) is the same with determining the identity of
the
designated object(means lvalue).
Lvalue(s.x) equals to address of s plus offset of field x.
IOW, Lvalue(s,x) = Address(s) + offset(x)
There's no need for reading the contents of s. So no read on s.
(But when pointer dereferencing is used for LHS,it will require
reading
the operand of dereference operator.
e.g) *(s.pointer_field) = e; // reading s.pointer_field)
Evaluation of (2) involves side effect as well as value computation.
i) value computation of (2) : Rvalue(s.x++)
It also does not require reading the variable s. Instead, it requires
reading the memory of Address(s)+offset(x).
ii) side effect of (2) : increment by one at the memory of
Lvalue(s.x).
After evaluation of (1) and (3), assignment operator will commence.
side effect of (1) : nothing.
side effect of (3) :
write to `address(s) + offset(x)' which occurred at `previous SP'.
assignment is writing to Lvalue of (1) which is Address(s)+offset(x).
So write to Address(s)+offset(x) does not conflict with side effects
of
(1) and (3).