Standard is clear about the order of evaluation of the operands of the shift operator.
n4659 - §8.8 (p4):
The expression E1
is sequenced before the expression E2
.
There is no undefined behavior in the expression i++ << i
, it is well defined. It is a bug in Clang and GCC both.