This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56343] New: [C++11] Destructor defaulted on first declaration has wrong implicit exception specification
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Feb 2013 14:35:45 +0000
- Subject: [Bug c++/56343] New: [C++11] Destructor defaulted on first declaration has wrong implicit exception specification
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56343
Bug #: 56343
Summary: [C++11] Destructor defaulted on first declaration has
wrong implicit exception specification
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
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