This is exactly what the compiler is saying, there is no way to guarantee what will happen to this expression that generates side effects, there is nothing in the specification that forces the code to work in a certain way, that is undefined behavior . There is no guaranteed order of execution. When changing a variable more than once in the same expression, among other operations, it is difficult to define the correct result.
Essentially, never use assignment operators in complex operations like this, unless you are very well aware of what you are doing. If you do each separate operation it results in 15.
This is explained in more details on Wikipedia .
See how the current version of GCC generates code and notice the change in order compared to what is expected.
Now see how Clang 5.0 builds and note that it acts as expected.
Put in your browser and see how Clang actually generates the correct result of 15 (yes, you are running on your browser).