This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56343] New: [C++11] Destructor defaulted on first declaration has wrong implicit exception specification


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]