From 7af5619836cb3bd2eca87fd10b81674c9e201e76 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 29 Jan 2020 12:57:25 -0800 Subject: [PATCH] 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 --- src/corelib/tools/qlinkedlist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 8970d39be0..3b8c75b122 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -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