I always understood that the lack of a sequence point after reading the correct expression in the assignment makes an example similar to the following undefined result:
void f(void) { int *p; p = (int [2]){*p}; }
However, this is Example 2 in the section "6.5.2.5. Mixed Literals" in the draft committee for the C11 standard, the version designated as n1570, which, as I understand it, is the final draft (I do not have access to the final version).
So my question is: is there anything in the standard that gives this specific and specific behavior?
EDIT
I would like to elaborate on what I see as a problem, in response to some of the discussions that have arisen.
We have two conditions under which an undefined assignment is explicitly specified, according to 6.5p2 of the standard specified in dbush's answer:
1) The side effect of a scalar object is independent of the other side of the effect on the same scalar object.
2) A side effect on a scalar object is independent of the value of the calculation using the value of the same scalar object.
An example of element 1 is "i = ++ i + 1". In this case, the side effect of writing the value i + 1 to i due to ++ i does not affect the side effect of assigning RHS to LHS. There is a point in the sequence between calculating the values ​​of each side and the RHS assignment for the LHS, as described in 6.5.16.1 given in Jens Gustedt's answer below. However, the change i due to ++ i am not subject to this point of the sequence, otherwise the behavior to be determined.
In the above example, we have a similar situation. There is a calculation of values, which includes creating an array and converting this array into a pointer to its first element. There is also a side effect of writing a value for part of this array, * p for the first element.
So, I don’t see what we have in the standard that modifying the other uninitialized first element of the array will be sequenced before writing the address of the array to p. As for this modification (writing * p on the first element) is different from the modification of writing i + 1 to i?
In other words, suppose that the implementation considered the representation of interest in the example as three tasks: 1st, allocate space for the composite literal; 2nd: assign a pointer to the specified space on p; 3rd: write * p to the first element in the newly allocated space. The calculation of the values ​​for RHS and LHS will be sequenced before the assignment, since the calculation of the RHS value requires only an address. How does this hypothetical implementation fall short of the standard?