This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: C++ PATCH to stop emitting code for throw() by default
- From: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Mar 2010 14:25:29 -0500
- Subject: Re: RFC: C++ PATCH to stop emitting code for throw() by default
- References: <4BA79DB0.9090804@redhat.com>
- Reply-to: gdr at integrable-solutions dot net
On Mon, Mar 22, 2010 at 11:41 AM, Jason Merrill <jason@redhat.com> wrote:
> At the Pittsburgh meeting last week there was a lot of talk about changes to
> exception specifications in C++0x: the short version is that they will be
> deprecated, to be replaced with an alternate form that just says whether or
> not the function will throw, with an integral constant expression operand.
> ?For more information, see N3050 in the post-meeting mailing (when that
> comes out), or the earlier version
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html).
>
> That got me thinking that there's not much point in us emitting the code
> necessary to catch an exception and call unexpected() in a function with a
> throw() exception-specification; it will pass along to terminate()
> eventually, and so we might as well just emit nothing and let the unwinder
> call terminate() directly by default.
>
> So, this patch does that by default. ?-ansi, -std=c++98, -std=c++0x, or
> -fenforce-eh-specs will enable fully conformant handling.
>
> Thoughts?
>
this probably should not be the default. My suspicion is that it should
be controlled by a flag that users activate to request non-standard
implementation.
-- Gaby