<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2711</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="2711"></A><H4>2711.
  
Source for copy-initializing the exception object
</H4>
<B>Section: </B>7.6.18&#160; [<A href="https://wg21.link/expr.throw">expr.throw</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Brian Bi
 &#160;&#160;&#160;

 <B>Date: </B>2023-03-26<BR>


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



<P>Neither 14.2 [<A href="https://wg21.link/except.throw">except.throw</A>] nor 7.6.18 [<A href="https://wg21.link/expr.throw">expr.throw</A>]
specifiy the source for copy-initializing the exception object.</P>

<P><B>Proposed resolution (based on the resolution of
<A HREF="2699.html">issue 2699</A>; approved by CWG
2023-06-12):</B></P>

<OL>

<LI>
<P>Change in 7.6.18 [<A href="https://wg21.link/expr.throw#2">expr.throw</A>] paragraph 2 as follows:</P>

<BLOCKQUOTE>

Evaluating a <I>throw-expression</I> with an operand throws an
exception (14.2 [<A href="https://wg21.link/except.throw">except.throw</A>]); the type of the exception
object is determined by removing any top-level <I>cv-qualifier</I>s
from the static type of the operand and adjusting the type from
&#8220;array of T&#8221; or function type T to &#8220;pointer to
T&#8221;.
<INS>The exception object is copy-initialized
(9.5.1 [<A href="https://wg21.link/dcl.init.general">dcl.init.general</A>]) from the (possibly converted) operand.</INS>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 14.2 [<A href="https://wg21.link/except.throw#3">except.throw</A>] paragraph 3 as follows:</P>

<BLOCKQUOTE>

Throwing an exception <DEL>copy-</DEL>initializes
<DEL>(9.5 [<A href="https://wg21.link/dcl.init">dcl.init</A>], 11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>])</DEL>
a temporary object, called the exception object. If the type of the
exception object would be an incomplete type
<INS>(6.9.1 [<A href="https://wg21.link/basic.types.general">basic.types.general</A>])</INS>, an abstract class type
(11.7.4 [<A href="https://wg21.link/class.abstract">class.abstract</A>]), or a pointer to an incomplete type
other than cv void <INS>(6.9.4 [<A href="https://wg21.link/basic.compound">basic.compound</A>]),</INS>
the program is ill-formed.

</BLOCKQUOTE>

</LI>
</OL>

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