From 1cf8674fa5e6bd515712ef365701c764b4b89a80 Mon Sep 17 00:00:00 2001 From: PBerger Date: Mon, 27 Oct 2014 02:05:41 +0100 Subject: [PATCH] Added noexcept Destructors to the exceptions to fix the picky Clang3.5 compiler errors. Former-commit-id: f620e5ed7deccafa3aa8115fe3883bd97323b527 --- src/exceptions/BaseException.cpp | 4 ++++ src/exceptions/BaseException.h | 5 +++++ src/exceptions/ExceptionMacros.h | 2 ++ 3 files changed, 11 insertions(+) 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; \