From 5923fb966d3d869b23f74bc43560b08921f4321b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 1 Jun 2015 00:22:35 +0200 Subject: 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 --- src/corelib/tools/qdatetimeparser.cpp | 4 ++++ src/corelib/tools/qdatetimeparser_p.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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, -- cgit v1.2.3