<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1354</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="1354"></A><H4>1354.
  
Destructor exceptions for temporaries in noexcept expressions
</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>CD3
 &#160;&#160;&#160;

 <B>Submitter: </B>Sebastian Redl
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-16<BR>


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



<P>The result of the <TT>noexcept</TT> operator does not consider possible
exceptions thrown by the destructors for temporaries created in the
operand expression.</P>

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

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

<BLOCKQUOTE>

A <I>full-expression</I> is an expression that is not a subexpression
of another expression. <INS>[<I>Note:</I> in some contexts such as
unevaluated operands, a syntactic subexpression is considered a
full-expression (Clause 7 [<A href="https://wg21.link/expr">expr</A>]). &#8212;<I>end
note</I>]</INS> If a language construct...

</BLOCKQUOTE>

<LI><P>Change Clause 7 [<A href="https://wg21.link/expr#7">expr</A>] paragraph 7 as follows:</P></LI>

<BLOCKQUOTE>

...An unevaluated operand is not evaluated. <INS>An unevaluated
operand is considered a full-expression.</INS> [<I>Note:</I>...

</BLOCKQUOTE>

</OL>

<P><I>[Drafting note: This uniformly handles <TT>sizeof(A())</TT>,
<TT>noexcept(A())</TT>, <TT>typeid(A())</TT>, and
<TT>decltype(A())</TT> with regard to the semantic requirements on
<TT>~A</TT> (accessible and not deleted), which might be checked via
SFINAE. A programmer can use <TT>decltype(new A)</TT> to avoid
considering the destructor. If this is undesired, an alternative
change just addresses the noexecept issue:]</I></P>

<P><I>[Editing note: all the occurrences of &#8220;potentially
evaluated&#8221; in 7.6.2.7 [<A href="https://wg21.link/expr.unary.noexcept#3">expr.unary.noexcept</A>] paragraph 3 should
be hyphenated.]</I></P>

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