<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1863</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="1863"></A><H4>1863.
  
Requirements on thrown object type to support <TT>std::current_exception()</TT>
</H4>
<B>Section: </B>14.2&#160; [<A href="https://wg21.link/except.throw">except.throw</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Canada
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-22<BR><BR>


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

<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#CA12">N3690 comment
  CA&#160;12<BR></A>

<P>The specification of <TT>std::current_exception()</TT> in
17.9.7 [<A href="https://wg21.link/propagation">propagation</A>] allows either referring to the exception object
itself or to a copy thereof, implying that the exception object must be
copyable.  However, the specification of <I>throw-expression</I> allows
throwing objects that cannot be copied, only moved.  Presumably the
requirements should include a non-deleted accessible copy constructor that
is odr-used by a <I>throw-expression</I>, even if the object being thrown
is moved to the exception object.</P>

<P><B>Additional note, February, 2014:</B></P>

<P>This issue was referred to CWG by EWG at the September, 2013 meeting
but was overlooked at that time.  </P>

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

<OL>
<LI><P>Change 11.4.7 [<A href="https://wg21.link/class.dtor#11">class.dtor</A>] paragraph 11 as follows:</P></LI>

<BLOCKQUOTE>

...A destructor is potentially invoked if it is invoked or
as specified in 7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>]<DEL>
and</DEL><INS>,</INS> 11.9.3 [<A href="https://wg21.link/class.base.init">class.base.init</A>]<INS>, and
14.2 [<A href="https://wg21.link/except.throw">except.throw</A>]</INS>. A program is ill-formed
if...

</BLOCKQUOTE>

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

<BLOCKQUOTE>

When the thrown object is a class object, the constructor
selected for the copy-initialization <INS>as well as the
constructor selected for a copy-initialization considering
the thrown object as an lvalue</INS> <DEL>and the
destructor</DEL> shall be <INS>non-deleted and</INS>
accessible, even if the copy/move operation is elided
(11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>]). <INS>The destructor is
potentially invoked (11.4.7 [<A href="https://wg21.link/class.dtor">class.dtor</A>]).</INS>

</BLOCKQUOTE>

</OL>

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