diff --git a/src/exceptions/BaseException.cpp b/src/exceptions/BaseException.cpp index 0acae02ac..8a295b541 100644 --- a/src/exceptions/BaseException.cpp +++ b/src/exceptions/BaseException.cpp @@ -13,6 +13,10 @@ namespace storm { BaseException::BaseException(char const* cstr) { stream << cstr; } + + BaseException::~BaseException() { + // Intentionally left empty. + } const char* BaseException::what() const throw() { std::string errorString = this->stream.str(); diff --git a/src/exceptions/BaseException.h b/src/exceptions/BaseException.h index 8bf12ea23..f6fb488a0 100644 --- a/src/exceptions/BaseException.h +++ b/src/exceptions/BaseException.h @@ -29,6 +29,11 @@ namespace storm { */ BaseException(char const* cstr); + /*! + * Declare a destructor to counter the "looser throw specificator" error + */ + virtual ~BaseException() throw(); + /*! * Retrieves the message associated with this exception. * diff --git a/src/exceptions/ExceptionMacros.h b/src/exceptions/ExceptionMacros.h index 943990ae7..e7bfe5885 100644 --- a/src/exceptions/ExceptionMacros.h +++ b/src/exceptions/ExceptionMacros.h @@ -13,6 +13,8 @@ exception_name(char const* cstr) : BaseException(cstr) { \ } \ exception_name(exception_name const& cp) : BaseException(cp) { \ } \ +~exception_name() throw() { \ +} \ template \ exception_name& operator<<(T const& var) { \ this->stream << var; \