UPDATE: As marked by user ecatmur, it's a duplicate of In C99, is f()+g() undefined or merely unspecified? (although the questions asks about C99, but answer is unchanged for C++). And the answer is: unspecified (for both cases).
Consider following C++14 code fragment:
int i = 0;
int x() { i++; return i;}
int y() { i++; return i;}
bool z = (x() > y()); // unspecified or undefined ?
Is the value of z
merely unspecified, or is this undefined behavior ?
As per my understanding (please correct if I am wrong), an expression of the kind: i++ > i++
will be undefined behavior, as we are mutating same variable twice between a pair of sequence points, but what about the case above (where mutation happen in separate functions) ?
And what about this one:
bool z = (x() > i++); // undefined or unspecified now ?