This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


438. Possible flaw in wording for multiple accesses to object between sequence points

Section: Clause 7  [expr]     Status: CD2     Submitter: Jason Merrill     Date: 29 Oct 2003

Lisa Lippincott mentioned this case to me:

  A[0] = 0;
  A[A[0]] = 1;

This seems to use the old value of A[0] other than to calculate the new value, which is said to be undefined, but it also seems reasonable, since the old value is used in order to select the object to modify, so there's no ordering ambiguity.

Steve Adamczyk: the ordering rule referred to is in Clause 7 [expr] paragraph 4.

Notes from the March 2004 meeting:

Clark Nelson mentions that the C committee may have done something on this.

Note (July, 2009):

This issue was resolved by the adoption of the “sequenced before” wording.