331. bad declaration of destructor for ios_base::failure

Section: 30.5.3.1.1 [ios::failure] Status: CD1 Submitter: PremAnand M. Rao Opened: 2001-08-23 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [ios::failure].

View all issues with CD1 status.

Discussion:

With the change in 20.5.5.12 [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 21.7.2 [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.