<div dir="ltr">On 11 December 2013 15:41, Howard Hinnant <span dir="ltr"><<a href="mailto:howard.hinnant@gmail.com" target="_blank">howard.hinnant@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Dec 9, 2013, at 4:42 PM, Mark Seaborn <<a href="mailto:mseaborn@chromium.org">mseaborn@chromium.org</a>> wrote:<br>
> Hi howard.hinnant,<br>
><br>
> Fix std::uncaught_exception() to return true during exception initialization<br>
><br>
> std::uncaught_exception() should return true during the call to the<br>
> copy constructor that "throw X" does to initialize the exception<br>
> object after the expression X has been evaluated (or during the call<br>
> to the normal constructor if the compiler has done copy elision).</div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

It appears to me that that CWG 475 (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475</a>) decided in  April 2006 the opposite direction of the fix made to gcc implemented a year earlier.<br>

<br>
The current draft retains the wording from CWG 475 (15.5.3/p1):<br>
<br>
> The function std::uncaught_exception() returns true *after* completing the initialization of the exception object...<br>
<br>
(I added the emphasis)<br>
<br>
The current output of your test on OS X:<br>
<br>
std::uncaught_exception()=0<br>
<br>
appears to me to be the standard conforming output.</blockquote><div><br></div><div>OK, that makes sense.  Particularly since an exception that occurs in the throw's call to the copy constructor is catchable, unlike an exception that occurs in a catch's call to a copy constructor.  The intention seems to be that std::uncaught_exception() returns true in contexts where any exception would be uncatchable by an outer "try" block.</div>
<div><br></div><div>Thanks for checking.  I'll close the issue (PR18193).</div><div><br></div><div>Cheers,</div><div>Mark</div><div><br></div></div></div></div>