<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 631</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="631"></A><H4>631.
  
Jumping into a &#8220;then&#8221; clause
</H4>
<B>Section: </B>8.5.2&#160; [<A href="https://wg21.link/stmt.if">stmt.if</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>James Kanze
 &#160;&#160;&#160;

 <B>Date: </B>24 April 2007<BR>


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

<P>8.5.2 [<A href="https://wg21.link/stmt.if">stmt.if</A>] is silent about whether the <TT>else</TT>
clause of an <TT>if</TT> statement is executed if the condition is not
evaluated.  (This could occur via a <TT>goto</TT> or a <TT>longjmp</TT>.)
C99 covers the <TT>goto</TT> case with the following provision:</P>

<BLOCKQUOTE>

If the first substatement is reached via a label, the second
substatement is not executed.

</BLOCKQUOTE>

<P>It should probably also be stated that the condition is not
evaluated when the &#8220;then&#8221; clause is entered directly.</P>

<P><B>Proposed resolution (February, 2012):</B></P>

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

<BLOCKQUOTE>

If the condition (8.5 [<A href="https://wg21.link/stmt.select">stmt.select</A>]) yields <TT>true</TT> the
first substatement is executed.  If the <TT>else</TT> part of the
selection statement is present and the condition yields
<TT>false</TT>, the second substatement is executed. <INS>If the first
substatement is reached via a label, the condition is not evaluated
and the second substatement is not executed.</INS> In the second
form...

</BLOCKQUOTE>

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