This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57645] New: Explicitly-declared destructor with no exception specification is always noexcept(true)
- From: "travis at gockelhut dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jun 2013 05:08:53 +0000
- Subject: [Bug c++/57645] New: Explicitly-declared destructor with no exception specification is always noexcept(true)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57645
Bug ID: 57645
Summary: Explicitly-declared destructor with no exception
specification is always noexcept(true)
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: travis at gockelhut dot com
#include <type_traits>
struct Thrower
{
~Thrower() noexcept(false) { throw 1; }
};
struct Explicit
{
~Explicit() {}
Thrower t;
};
static_assert(!std::is_nothrow_destructible<Explicit>::value, "Explicit");
This will fail on the static_assert in 4.8, in contrast to Â15.4.14:
> ..If f is an...destructor...it's implicit exception-specification specifies...f has the exception-specification noexcept(true) if every function it directly invokes allows no exceptions.
And Thrower::~Thrower is directly invoked according to Â12.4.8:
> After executing the body of the destructor and destroying any automatic objects allocated within the body, a destructor for class X calls the destructors for Xâs direct non-variant non-static data members...