<div dir="ltr"><div>There are cases where exceptions paths being UB is preferable for 
optimization reasons, but I guess that's not common (MS's standard 
library throws via an external call, libstdc++ calls abort()...).  Allowing a custom handler sounds OK.<br></div><div><br></div>If
 you're going to change exceptional cases to call abort though, then 
it'd be good to make other cases to be consistent with that approach, like vector's __throw_length_error and __throw_out_of_range, regex's 
__throw_regex_error, and possibly others.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 27, 2015 at 7:03 AM, Asiri Rathnayake <span dir="ltr"><<a href="mailto:asiri.rathnayake@gmail.com" target="_blank">asiri.rathnayake@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Asserts getting optimized away is a problem, as then an exceptional code path will simply ignore the error and continue. Of course, one can argue that an exceptional state in a no-exceptions library is something that is OK to be ignored.</div><div><br></div><div>In my latest patch [1], the user has the option to override the default abort behaviour by providing a custom __libcxx_noexceptions_abort() function. I think with this mechanism you can achieve the old behaviour if desired.</div><div><br></div><div>Cheers,</div><div><br></div><div>- Asiri</div><div><br></div><div>[1] <a href="http://reviews.llvm.org/D14653" target="_blank">http://reviews.llvm.org/D14653</a></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Nov 26, 2015 at 5:00 PM, via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">




<div dir="ltr">
<div dir="ltr" style="font-family:'Calibri','Segoe UI','Meiryo','Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','sans-serif';font-size:12pt"><div>Wouldn’t the better thing to do be to assert rather than call abort (like vector’s exceptions already do, for instance)?  One important use case of no-exception builds is to completely optimize out throwing paths and the checks leading to them, which wouldn’t happen if the exceptional path called abort.</div></div>
</div>

<br></span>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>