This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.

331. bad declaration of destructor for ios_base::failure

Section: 31.5.2.2.1 [ios.failure] Status: CD1 Submitter: PremAnand M. Rao Opened: 2001-08-23 Last modified: 2021-06-06

Priority: Not Prioritized

View all other issues in [ios.failure].

View all issues with CD1 status.

Discussion:

With the change in 16.4.6.13 [res.on.exception.handling] to state "An implementation may strengthen the exception-specification for a non-virtual function by removing listed exceptions." (issue 119) and the following declaration of ~failure() in ios_base::failure

    namespace std {
       class ios_base::failure : public exception {
       public:
           ...
           virtual ~failure();
           ...
       };
     }

the class failure cannot be implemented since in 17.7.3 [type.info] the destructor of class exception has an empty exception specification:

    namespace std {
       class exception {
       public:
         ...
         virtual ~exception() throw();
         ...
       };
     }

Proposed resolution:

Remove the declaration of ~failure().

Rationale:

The proposed resolution is consistent with the way that destructors of other classes derived from exception are handled.