http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33799

--- Comment #7 from Kenton Varda <temporal at gmail dot com> ---
> It's now 2013 so the sensible thing to do is not return by value
> if your destructor can throw.

That actually sounds like a pretty difficult rule to follow, unless you either
ban throwing destructors altogether or ban returning by value altogether.

The don't-throw-from-destructors rule is, of course, popular, but not
universally agreed upon.  I don't think this bug is the right place to debate
it (maybe try http://goo.gl/haB5nm), but I would hope that GCC wouldn't refuse
to fix a bug simply because they disagree with the coding style that triggers
that bug.

> FWIW Clang also behaves the same as G++ and Intel,

Yes, I noticed, and Clang has also had a bug filed against them which has
languished for years.  Nevertheless, the behavior is wrong.

> and of course calls std::terminate() in C++11 mode.

Unless the destructor has noexcept(false).

Reply via email to