Unbreak ubsan developer-build

GCC 5.3's undefined-behavior sanitizer checks that the
declared type of the object is a base class of the
dynamic type of the object on each access to a member
of a class type.

It therefore requires the typeinfo for these types,
which for polymorphic types is emitted in the TU where
the vtable is emitted, too.

QFileDialogPrivate is a polymorphic non-exported class,
so this failed at link-time. Ditto for the other cases.

Fix by autotest-exporting the classs.

Also, where applicable, de-inline the dtors, so the
vtable (and typeinfo) are pinned to one TU, and the
ctor, just because it's the correct thing to do.

Change-Id: I2b7dba776282a2809c80eb2bc36440d7d698f926
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2016-01-06 10:01:07 +01:00
parent 6060ffff88
commit caee8f6107
7 changed files with 21 additions and 8 deletions

View File

@ -102,6 +102,15 @@ QFontListView::QFontListView(QWidget *parent)
static const Qt::WindowFlags DefaultWindowFlags =
Qt::Dialog | Qt::WindowSystemMenuHint;
QFontDialogPrivate::QFontDialogPrivate()
: writingSystem(QFontDatabase::Any), options(new QFontDialogOptions)
{
}
QFontDialogPrivate::~QFontDialogPrivate()
{
}
/*!
\class QFontDialog
\ingroup standard-dialogs

View File

@ -65,14 +65,13 @@ class QGroupBox;
class QLabel;
class QLineEdit;
class QFontDialogPrivate : public QDialogPrivate
class Q_AUTOTEST_EXPORT QFontDialogPrivate : public QDialogPrivate
{
Q_DECLARE_PUBLIC(QFontDialog)
public:
inline QFontDialogPrivate()
: writingSystem(QFontDatabase::Any), options(new QFontDialogOptions)
{ }
QFontDialogPrivate();
~QFontDialogPrivate();
QPlatformFontDialogHelper *platformFontDialogHelper() const
{ return static_cast<QPlatformFontDialogHelper *>(platformHelper()); }

View File

@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
class QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
class Q_AUTOTEST_EXPORT QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
{
Q_DECLARE_PUBLIC(QGraphicsProxyWidget)
public:

View File

@ -293,7 +293,7 @@ private:
};
class QListViewPrivate: public QAbstractItemViewPrivate
class Q_AUTOTEST_EXPORT QListViewPrivate: public QAbstractItemViewPrivate
{
Q_DECLARE_PUBLIC(QListView)
public:

View File

@ -1687,6 +1687,10 @@ QDateTimeEditPrivate::QDateTimeEditPrivate()
#endif
}
QDateTimeEditPrivate::~QDateTimeEditPrivate()
{
}
void QDateTimeEditPrivate::updateTimeSpec()
{
minimum = minimum.toDateTime().toTimeSpec(spec);

View File

@ -62,11 +62,12 @@
QT_BEGIN_NAMESPACE
class QCalendarPopup;
class QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, public QDateTimeParser
class Q_AUTOTEST_EXPORT QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, public QDateTimeParser
{
Q_DECLARE_PUBLIC(QDateTimeEdit)
public:
QDateTimeEditPrivate();
~QDateTimeEditPrivate();
void init(const QVariant &var);
void readLocaleSettings();

View File

@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
class QLabelPrivate : public QFramePrivate
class Q_AUTOTEST_EXPORT QLabelPrivate : public QFramePrivate
{
Q_DECLARE_PUBLIC(QLabel)
public: