QException: fix exception specification

Some broken compilers (known broken: GCC 4.7; known good: GCC 4.9)
don't understand that destructors are implicitly noexcept and
complain about a weaker exception specification on ~QException
than on ~std::exception.

Change-Id: I433475fcf345d7da55e8da667cf9821ee09c0d8a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2015-06-11 21:20:25 +02:00
parent 742c6ff5dc
commit 895dbac454
2 changed files with 13 additions and 5 deletions

View File

@ -108,7 +108,9 @@ QT_BEGIN_NAMESPACE
*/
QException::~QException()
#ifndef Q_COMPILER_NOEXCEPT
#ifdef Q_COMPILER_NOEXCEPT
noexcept
#else
throw()
#endif
{
@ -127,7 +129,9 @@ QException *QException::clone() const
}
QUnhandledException::~QUnhandledException()
#ifndef Q_COMPILER_NOEXCEPT
#ifdef Q_COMPILER_NOEXCEPT
noexcept
#else
throw()
#endif
{

View File

@ -54,7 +54,9 @@ class Q_CORE_EXPORT QException : public std::exception
{
public:
~QException()
#ifndef Q_COMPILER_NOEXCEPT
#ifdef Q_COMPILER_NOEXCEPT
noexcept
#else
throw()
#endif
;
@ -66,10 +68,12 @@ class Q_CORE_EXPORT QUnhandledException : public QException
{
public:
~QUnhandledException()
#ifndef Q_COMPILER_NOEXCEPT
#ifdef Q_COMPILER_NOEXCEPT
noexcept
#else
throw()
#endif
;
;
void raise() const Q_DECL_OVERRIDE;
QUnhandledException *clone() const Q_DECL_OVERRIDE;
};