<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1949</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1949"></A><H4>1949.
  
&#8220;sequenced after&#8221; instead of &#8220;sequenced before&#8221;
</H4>
<B>Section: </B>6.10.1&#160; [<A href="https://wg21.link/intro.execution">intro.execution</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-18<BR>


<P>[Moved to DR at the October, 2015 meeting.]</P>

<P>The term &#8220;sequenced after&#8221; is used in both the core and
library clauses instead of the more-correct &#8220;sequenced
before.&#8221;</P>



<P><B>Proposed resolution (May, 2015):</B></P>

<OL>
<LI><P>Change 6.10.1 [<A href="https://wg21.link/intro.execution#13">intro.execution</A>] paragraph 13 as follows:</P></LI>

<BLOCKQUOTE>

<I>Sequenced before</I> is an asymmetric, transitive,
pair-wise relation between evaluations executed by a single
thread (6.10.2 [<A href="https://wg21.link/intro.multithread">intro.multithread</A>]), which induces a partial
order among those evaluations. Given any two
evaluations <I>A</I> and <I>B</I>, if <I>A</I> is sequenced
before <I>B</I> <INS>(or, equivalently, <I>B</I>
is <I>sequenced after</I> <I>A</I>)</INS>, then the execution
of <I>A</I> shall precede the execution
of <I>B</I>. If <I>A</I> is not sequenced before <I>B</I>...

</BLOCKQUOTE>

<LI><P>Change 6.10.2 [<A href="https://wg21.link/intro.multithread#14">intro.multithread</A>] paragraph 14 as follows:</P></LI>

<BLOCKQUOTE>

An evaluation <I>A</I> <I>happens before</I> an
evaluation <I>B</I> <INS>(or,
equivalently, <I>B</I> <I>happens after</I> <I>A</I>)</INS>
if:...

</BLOCKQUOTE>

<LI><P>Change 6.10.1 [<A href="https://wg21.link/intro.execution#15">intro.execution</A>] paragraph 15 as follows:</P></LI>

<BLOCKQUOTE>

...<DEL>Every evaluation in the calling function (including other
function calls) that is not otherwise specifically sequenced
before or after the execution of the body of the called
function is indeterminately sequenced with respect to the
execution of the called function</DEL> <INS>For each function
invocation <I>F</I>, for every evaluation <I>A</I> that occurs
within <I>F</I> and every evaluation <I>B</I> that does not occur
within <I>F</I> but is evaluated on the same thread and as part
of the same signal handler (if any), either <I>A</I> is
sequenced before <I>B</I> or <I>B</I> is sequenced before
<I>A</I></INS>.<SUP>9</SUP> <INS>[<I>Note:</I> if <I>A</I> and
<I>B</I> would not otherwise be sequenced then they are
indeterminately sequenced. &#8212;<I>end note</I>]</INS>
Several contexts...

</BLOCKQUOTE>

<LI><P>Change 6.10.3.2 [<A href="https://wg21.link/basic.start.static#4">basic.start.static</A>] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

It is implementation-defined whether the dynamic
initialization of a non-local variable with static storage
duration <DEL>is done</DEL> <INS>happens</INS> before the
first statement of <TT>main</TT>. If the initialization is
deferred to <DEL>some point in time</DEL> <INS>happen</INS>
after the first statement of <TT>main</TT>, it <DEL>shall
occur</DEL> <INS>happens</INS> before the first odr-use
(6.3 [<A href="https://wg21.link/basic.def.odr">basic.def.odr</A>]) of any function or variable...

</BLOCKQUOTE>

<LI><P>Change 6.10.3.2 [<A href="https://wg21.link/basic.start.static#5">basic.start.static</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

It is implementation-defined whether the dynamic
initialization of a non-local variable with static or thread
storage duration is <DEL>done</DEL> <INS>sequenced</INS>
before the first statement of the initial function of the
thread. If the initialization is deferred to some point in
time <INS>sequenced</INS> after the first statement of the
initial function of the thread, it <DEL>shall
occur</DEL> <INS>is sequenced</INS> before the first odr-use
(6.3 [<A href="https://wg21.link/basic.def.odr">basic.def.odr</A>]) of any variable with thread
storage duration defined in the same translation unit as the
variable to be initialized.

</BLOCKQUOTE>

<LI><P>Change 8.6.4 [<A href="https://wg21.link/stmt.for#1">stmt.for</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...[<I>Note:</I> Thus the first statement specifies
initialization for the loop; the condition
(8.5 [<A href="https://wg21.link/stmt.select">stmt.select</A>]) specifies a
test, <DEL>made</DEL> <INS>sequenced</INS> before each
iteration, such that the loop is exited when the condition
becomes <TT>false</TT>; the expression often specifies
incrementing that is <DEL>done</DEL> <INS>sequenced</INS>
after each iteration.  &#8212;<I>end note</I>]

</BLOCKQUOTE>

<LI><P>Add the following as a new paragraph at the end of
Clause 14 [<A href="https://wg21.link/except">except</A>]:</P></LI>

<BLOCKQUOTE>

<INS>In this section, &#8220;before&#8221; and &#8220;after&#8221;
refer to the &#8220;sequenced before&#8221; relation
(6.10.1 [<A href="https://wg21.link/intro.execution">intro.execution</A>]).</INS>

</BLOCKQUOTE>

</OL>

<BR><BR>
</BODY>
</HTML>
