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: unassig...@gcc.gnu.org

        ReportedBy: r...@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

Reply via email to