Trunk rejects this: class B { public: virtual ~B() noexcept(false) { } }; class D : public B { public: virtual ~D() = default; }; t.cc:10:11: error: function 'virtual D::~D()' defaulted on its first declaration with an exception-specification that differs from the implicit declaration 'D::~D()' virtual ~D() = default; ^ [class.dtor]/3 "A declaration of a destructor that does not have an exception-specification is implicitly considered to have the same exception-specification as an implicit declaration (15.4)." [dcl.fct.def.default]/2 "If a function is explicitly defaulted on its first declaration [...] it is implicitly considered to have the same exception-specification as if it had been implicitly declared (15.4)." Possibly related to PR 53903
Author: jason Date: Fri Feb 15 17:19:45 2013 New Revision: 196082 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196082 Log: PR c++/56343 * class.c (check_bases_and_members): Deduce noexcept after checking bases. Added: trunk/gcc/testsuite/g++.dg/cpp0x/defaulted41.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c
Fixed.