Interesting, on looking further at this, I think that although illegal
in C++98, the expression ++++i is valid in C++11/14.
The complete normative reading of §1.9/15 of C++11, with examples and
parenthetical comments removed, is:
"Except where noted, evaluations of operands of individual operators
and of subexpressions of individual expressions are unsequenced. The
value computations of the operands of an operator are sequenced
before the value computation of the result of the operator. If a side
effect on a scalar object is unsequenced relative to either
another side effect on the same scalar object or a value computation
using the value of the same scalar object, the behavior is undefined."
It is the second sentence which is important. ++++i is in effect
identical in C++11 to ++i,++i. Likewise although the behaviour of this
is unspecified in C++98, I think it is required to increment by 2 in
C++11:
i = ++i + 1
However, this is still undefined in C++98 and C++11:
i = i++ + 1
Turning to the examples given in the standard, the reason why in C++11
this:
i = v[i++];
is undefined is that although the assignment to i is sequenced before
the evaluation of v[i] on the right hand side, the subsequent side
effect comprising the increment of i carried out on the right hand side
is not. So the increment of i on the right hand side and the assignment
to i are unsequenced. On the other hand this:
v[++i] = ++i;
is invalid in C++11 (I think) because, although the assignment is
sequenced before the evaluation of the right hand side, the
prior evaluation of the subexpression ++i on the left hand side is
unsequenced with respect to the evaluation of ++i on the right hand
side.
Err, I think.
Chris