summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-05-26 22:16:25 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-06-02 21:50:53 +0000
commit2fa7b3b317fa941064ec4ba62163e3244becf55a (patch)
treed1d89310e353901412a1cc1b0f7aad7e56191813
parentb1a0cf72f84803196539c4b0b03bfaeea9000d94 (diff)
Q(Unhandled)Exception: declare dtor out-of-line
De-duplicates vtables and enables RTTI on this hierarchy. This is esp. important for exception classes, as RTTI is used to select the catch clause to handle the exception in-flight. The issue is made a bit complicated by the fact that the exception specification changed from C++98 to 11 and that C++98 clients require the empty throw() specification while we don't want to introduce warnings for C++11 users. Let's hope no compiler includes throw specs into the mangled names. Task-number: QTBUG-45582 Change-Id: If086c8c38fccdc2c9c7e2aa7a492192cc1f86a6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/thread/qexception.cpp10
-rw-r--r--src/corelib/thread/qexception.h10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index acc3663936..550bdc8fe4 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -107,6 +107,11 @@ QT_BEGIN_NAMESPACE
\internal
*/
+QException::~QException()
+{
+ // must stay empty until ### Qt 6
+}
+
void QException::raise() const
{
QException e = *this;
@@ -118,6 +123,11 @@ QException *QException::clone() const
return new QException(*this);
}
+QUnhandledException::~QUnhandledException()
+{
+ // must stay empty until ### Qt 6
+}
+
void QUnhandledException::raise() const
{
QUnhandledException e = *this;
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index 55fc441020..edf361ebd3 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -53,6 +53,11 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QException : public std::exception
{
public:
+ ~QException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+ ;
virtual void raise() const;
virtual QException *clone() const;
};
@@ -60,6 +65,11 @@ public:
class Q_CORE_EXPORT QUnhandledException : public QException
{
public:
+ ~QUnhandledException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+;
void raise() const Q_DECL_OVERRIDE;
QUnhandledException *clone() const Q_DECL_OVERRIDE;
};