summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-01 00:22:35 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-02-05 18:29:47 +0000
commit5923fb966d3d869b23f74bc43560b08921f4321b (patch)
treee616fc60917b0017cb732b1a84420950ef2daea2
parent239418a947dc5230ce295b04edc5ee5b59009c7b (diff)
QDateTimeParser: de-duplicate vtable
QDateTimeEdit (QtWidgets) inherits its Private class from QDateTimeParser. By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. Since the class is already exported, users of these classes are unaffected by the change, and since it's private API, we don't need to avoid adding code to the out-of-line destructor until Qt 6. Task-number: QTBUG-45582 Change-Id: Id57289a7eff13564dddeca0af1c45a6180c36c48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp4
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 65016933a0..d66416207b 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -60,6 +60,10 @@ QT_BEGIN_NAMESPACE
#ifndef QT_BOOTSTRAPPED
+QDateTimeParser::~QDateTimeParser()
+{
+}
+
/*!
\internal
Gets the digit from a datetime. E.g.
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index bc088a5f4c..b50c88b4c1 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -103,7 +103,7 @@ public:
none.count = -1;
none.zeroesAdded = 0;
}
- virtual ~QDateTimeParser() {}
+ virtual ~QDateTimeParser();
enum Section {
NoSection = 0x00000,