This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 57645
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Thu, 20 Jun 2013 02:22:04 +0200
- Subject: Re: [C++ Patch] PR 57645
- References: <51C1B3FF dot 4070901 at oracle dot com>
Hi again,
On 06/19/2013 03:37 PM, Paolo Carlini wrote:
Hi,
when I implemented Core/1123 "Destructors should be noexcept by
default", unfortunately I caused this regression, present now in
mainline and 4_8-branch.
When the destructor is user provided, with no exception
specifications, and the type has data members (not bases, those are
already Ok) with the destructor which can throw, the destructor is
wrongly deduced to be noexcept. The reason is that
deduce_noexcept_on_destructors is called from check_bases_and_members
after check_bases but *before* check_methods and therefore the latter
does too late work relevant for the deduction, namely possibly setting
TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
I can confirm that the issue in very general terms is this one, but my
patch isn't Ok. Sorry. For example, it doesn't handle correctly the
defaulted destructor case.
If, in check_bases_and_members, I simply move
deduce_noexcept_on_destructors after check_methods and nothing else, all
the new testcases are fine + the tests added for Core/1123, but there
are regressions, for example for testcases involving virtual
destructors, eg, debug/dwarf2/non-virtual-thunk.C.
All in all the issue seems rather nasty to me, I'm afraid I will need
some help if we want to quickly make substantive progress on this issue.
Thanks,
Paolo.