summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qexception.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-11 21:20:25 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-06-17 13:22:50 +0000
commit895dbac45497d1b9918a0fafa9df8277f8069e37 (patch)
treea4049a6e2ecd997f60978be02f9de83f34b7b1fc /src/corelib/thread/qexception.h
parent742c6ff5dcd91860154c784c46e562bbe4d63d5e (diff)
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>
Diffstat (limited to 'src/corelib/thread/qexception.h')
-rw-r--r--src/corelib/thread/qexception.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index edf361ebd3..7fb798fdad 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -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;
};