<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2792</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="2792"></A><H4>2792.
  
Clean up specification of <TT>noexcept</TT> operator
</H4>
<B>Section: </B>7.6.2.7&#160; [<A href="https://wg21.link/expr.unary.noexcept">expr.unary.noexcept</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jan Schultke
 &#160;&#160;&#160;

 <B>Date: </B>2023-08-30<BR>


<P>[Accepted as a DR at the November, 2023 meeting.]</P>

<P>The introductory sentence "can throw an exception" is misleading,
because it might be interpreted to cover exceptions thrown as the
result of encountering undefined behavior.</P>

<P><B>Proposed resolution (approved by CWG 2023-10-06):</B></P>

<P>Change all of 7.6.2.7 [<A href="https://wg21.link/expr.unary.noexcept">expr.unary.noexcept</A>] as follows:</P>

<BLOCKQUOTE>

<P>
<DEL>The noexcept operator determines whether the evaluation of its
operand, which is an unevaluated operand (7.2.3 [<A href="https://wg21.link/expr.context">expr.context</A>]),
can throw an exception (14.2 [<A href="https://wg21.link/except.throw">except.throw</A>]).</DEL>
<PRE>
<I>noexcept-expression</I>:
        noexcept ( <I>expression</I> )
</PRE>
</P>

<P class="ins">
The operand of the <TT>noexcept</TT> operator is an unevaluated operand
(7.2.3 [<A href="https://wg21.link/expr.context">expr.context</A>]).  If the operand is a prvalue, the
temporary materialization conversion (7.3.5 [<A href="https://wg21.link/conv.rval">conv.rval</A>]) is
applied.
</P>

<P>The result of the <TT>noexcept</TT> operator is a prvalue of
type <TT>bool</TT>.
<INS>
The result is <TT>false</TT> if the full-expression of the operand is
potentially-throwing (14.5 [<A href="https://wg21.link/except.spec">except.spec</A>]), and <TT>true</TT>
otherwise.
</INS>

</P>

<P>
[<I>Note 1:</I> A <I>noexcept-expression</I> is an integral constant
expression (7.7 [<A href="https://wg21.link/expr.const">expr.const</A>]). &#8212;<I>end note</I>]</P>

<P><DEL>If the operand is a prvalue, the temporary materialization
conversion (7.3.5 [<A href="https://wg21.link/conv.rval">conv.rval</A>]) is applied. The result of the
noexcept operator is true unless the full-expression of the operand is
potentially-throwing (14.5 [<A href="https://wg21.link/except.spec">except.spec</A>]).</DEL></P>

</BLOCKQUOTE>

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