Created on 1998-12-15.00:00:00 last changed 184 months ago
Proposed resolution:
Change Section [res.on.exception.handling] from:
"may strengthen the exception-specification for a function"
to:
"may strengthen the exception-specification for a non-virtual function".
Section [res.on.exception.handling] states:
"An implementation may strengthen the exception-specification for a function by removing listed exceptions."
The problem is that if an implementation is allowed to do this for virtual functions, then a library user cannot write a class that portably derives from that class.
For example, this would not compile if ios_base::failure::~failure had an empty exception specification:
#include <ios>
#include <string>
class D : public std::ios_base::failure {
public:
D(const std::string&);
~D(); // error - exception specification must be compatible with
// overridden virtual function ios_base::failure::~failure()
};
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2010-10-21 18:28:33 | admin | set | messages: + msg1075 |
| 1998-12-15 00:00:00 | admin | create | |