Title
Typo in 15.4
Status
nad
Section
14.5 [except.spec]
Submitter
Lois Goldthwaite

Created on 2002-03-18.00:00:00 last changed 261 months ago

Messages

Date: 2002-10-15.00:00:00

Notes from October 2002 meeting:

This was previously resolved by an editorial change.

Date: 2022-02-18.07:47:23

14.5 [except.spec] paragraph 13 contains the following text. I believe 'implicitLY' marked below should be replaced with 'implicit.'

An implicitly declared special member function (11.4.4 [special]) shall have an exception-specification. If f is an implicitly declared default constructor, copy constructor, destructor, or copy assignment operator, its implicit exception-specification specifies the type-id T if and only if T is allowed by the exception-specification of a function directly invoked by f's implicitly definition; f shall allow all exceptions if any function it directly invokes allows all exceptions, and f shall allow no exceptions if every function it directly invokes allows no exceptions. [Example:

    struct A {
        A();
        A(const A&) throw();
        ~A() throw(X);
    };
    struct B {
        B() throw();
        B(const B&) throw();
        ~B() throw(Y);
    };
    struct D : public A, public B {
            //  Implicit declaration of  D::D();
            //  Implicit declaration of  D::D(const   D&)   throw();
            //  Implicit declaration of  D::~D()   throw   (X,Y);
    };

Furthermore, if A::~A() or B::~B() were virtual, D::~D() would not be as restrictive as that of A::~A, and the program would be ill-formed since a function that overrides a virtual function from a base class shall have an exception-specification at least as restrictive as that in the base class. ]

The example code shows structs whose destructors have exception specifications which throw certain types. There is no defect here, but it doesn't sit well with our general advice elsewhere that destructors should not throw. I wish I could think of some other way to illustrate this section.

History
Date User Action Args
2002-11-08 00:00:00adminsetmessages: + msg788
2002-11-08 00:00:00adminsetstatus: open -> nad
2002-03-18 00:00:00admincreate