QLinkedListData: Move Q_CORE_EXPORT from class to shared_null

This makes no difference for the IA-64 C++ ABI nor for MSVC until MSVC
2019 16.6. But it does with 16.6, where the std::atomic constructor
becomes non-trivial, which makes QtPrivate::RefCount non-trivial, which
makes QLinkedListData non-trivial.

Before this change:

User code \ Qt		MSVC <=16.5	MSVC >=16.6
MSVC <=16.5		works		works
MSVC >=16.6		fails		works

With this change, they should all work. The list of symbols exported
should not change either, so linking against a Qt compiled with MSVC
<=16.5 should continue to work.

[ChangeLog][MSVC] Fixed a compatibility issue found when linking code
compiled with version 16.6 to a Qt compiled with 16.5.

Fixes: QTBUG-81727
Change-Id: If79a52e476594446baccfffd15ee771397467f8b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Thiago Macieira 2020-01-29 12:57:25 -08:00
parent c0c2efc3c6
commit 7af5619836

View File

@ -58,14 +58,14 @@
QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QLinkedListData
struct QLinkedListData
{
QLinkedListData *n, *p;
QtPrivate::RefCount ref;
int size;
uint sharable : 1;
static const QLinkedListData shared_null;
Q_CORE_EXPORT static const QLinkedListData shared_null;
};
template <typename T>