This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ RFC / Patch] Implementing "Deducing "noexcept" for destructors"
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 Mar 2012 01:05:21 +0200
- Subject: Re: [C++ RFC / Patch] Implementing "Deducing "noexcept" for destructors"
- References: <4F70515C.2090701@oracle.com> <4F70C403.5030005@redhat.com>
On 03/26/2012 09:31 PM, Jason Merrill wrote:
On 03/26/2012 07:22 AM, Paolo Carlini wrote:
My basic idea so far is very simple:
--- class.c (revision 185792)
+++ class.c (working copy)
@@ -1001,6 +1001,10 @@ add_method (tree type, tree method, tree
using_dec
"destructor",
type);
}
+ else if (cxx_dialect >= cxx0x
+ && !TYPE_RAISES_EXCEPTIONS (TREE_TYPE (method)))
+ TREE_TYPE (method) = build_exception_variant (TREE_TYPE (method),
+ noexcept_true_spec);
}
That would implement N1366, but implementing N3204 is a bit more
involved. You need to copy TYPE_RAISES_EXCEPTIONS from the result of
implicitly_declare_fn; see defaulted_late_check for something similar.
Also, this is too early, since we can't know what the eh specification
of the implicit declaration would be until the closing brace of the class.
Thanks for the help Jason.
Paolo.