From c59cb9809559f0aae6be8544cb2049e41f8040e9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 23 Mar 2018 11:34:10 +0100 Subject: [PATCH 1/6] Fix MSVC2017 compilation with enabled relaxed constexpr on 32-bit target The problem is that qCountLeadingZeroBits is calling qPopulationCount which is only conditionally constexpr, so qCountLeadingZeroBits can only be marked constexpr if qPopulationCount is also. On MSVC2017 64bit this is not a problem because it uses builtins function in this case. (which is not constexpr, but it works because the compiler is not forced to diagnose the problem because of the "?:" operator. The error being fixed is: qalgorithms.h(847): error C3615: constexpr function 'qCountLeadingZeroBits' cannot result in a constant expression qalgorithms.h(858): note: failure was caused by call of undefined function or one not declared 'constexpr' qalgorithms.h(858): note: see usage of 'qPopulationCount' Task-number: QTBUG-67259 Change-Id: I65a3dfae12ca49394bec14ffefdd41a07fee1c32 Reviewed-by: Thiago Macieira --- src/corelib/tools/qalgorithms.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h index 1a03bfaac4..b658d8afcf 100644 --- a/src/corelib/tools/qalgorithms.h +++ b/src/corelib/tools/qalgorithms.h @@ -590,6 +590,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NO } #elif defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM) #define QT_POPCOUNT_CONSTEXPR +#define QT_POPCOUNT_RELAXED_CONSTEXPR #define QT_HAS_BUILTIN_CTZ Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val) { @@ -676,6 +677,7 @@ Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW #ifndef QT_POPCOUNT_CONSTEXPR #define QT_POPCOUNT_CONSTEXPR Q_DECL_CONSTEXPR +#define QT_POPCOUNT_RELAXED_CONSTEXPR Q_DECL_RELAXED_CONSTEXPR #endif } //namespace QAlgorithmsPrivate @@ -819,7 +821,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOT #endif } -Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW +QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW { #if defined(QT_HAS_BUILTIN_CLZ) return v ? QAlgorithmsPrivate::qt_builtin_clz(v)-24U : 8U; @@ -831,7 +833,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTH #endif } -Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW +QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW { #if defined(QT_HAS_BUILTIN_CLZS) return v ? QAlgorithmsPrivate::qt_builtin_clzs(v) : 16U; @@ -844,7 +846,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOT #endif } -Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW +QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW { #if defined(QT_HAS_BUILTIN_CLZLL) return v ? QAlgorithmsPrivate::qt_builtin_clzll(v) : 64U; @@ -859,7 +861,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOT #endif } -Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) Q_DECL_NOTHROW +QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) Q_DECL_NOTHROW { return qCountLeadingZeroBits(QIntegerForSizeof::Unsigned(v)); } From f22ae9c0d059372d51990ec6fad04d7d829c990b Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Tue, 27 Mar 2018 09:35:43 +0300 Subject: [PATCH 2/6] QFutureWatcher: Refer to convenience method resultAt in documentation The future does not actually have a result() member function that takes an int. The correct function is resultAt(). But that is also available directly in the QFutureWatcher, so refer to that instead of advising to get to the future. Change-Id: I53d267b4b48b1171bf611e11130b9dacabc059a4 Reviewed-by: Martin Smith --- src/corelib/thread/qfuturewatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp index 8c4cb9a5a2..5b68af1fbc 100644 --- a/src/corelib/thread/qfuturewatcher.cpp +++ b/src/corelib/thread/qfuturewatcher.cpp @@ -576,7 +576,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event) This signal is emitted when the watched future reports a ready result at \a index. If the future reports multiple results, the index will indicate which one it is. Results can be reported out-of-order. To get the result, - call future().result(index); + call resultAt(index); */ /*! From be674bcdc500ce676e3127c70f5a7a54a4d714b3 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Mon, 26 Feb 2018 10:27:16 +0200 Subject: [PATCH 3/6] tst_QLocalSocket: Only expect debug messages if debug level is enabled Otherwise the ::debug() test fails when a build does not print qDebug() messages. Change-Id: I3f3c4b3c7d74004abe5ed8d7ac52164d4f88ef1f Reviewed-by: Joerg Bornemann --- tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 9a821deefe..08e9e05463 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -1193,7 +1193,8 @@ void tst_QLocalSocket::writeToClientAndDisconnect() void tst_QLocalSocket::debug() { // Make sure this compiles - QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState"); + if (QLoggingCategory::defaultCategory()->isDebugEnabled()) + QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState"); qDebug() << QLocalSocket::ConnectionRefusedError << QLocalSocket::UnconnectedState; } From ab4f3704d818aa2c49bc377be7234c657e1da99b Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Thu, 22 Mar 2018 15:56:59 +0200 Subject: [PATCH 4/6] Blacklist tst_Gestures::customGesture on openSUSE and Ubuntu Has been flaky on those platforms in CI. Task-number: QTBUG-67254 Task-number: QTBUG-66216 Change-Id: Ia1a718a23b1992fcc0e85bf49b714bc43acc4ce2 Reviewed-by: Ville Voutilainen --- tests/auto/other/gestures/BLACKLIST | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST index 1d89178fe5..169117b36a 100644 --- a/tests/auto/other/gestures/BLACKLIST +++ b/tests/auto/other/gestures/BLACKLIST @@ -1,2 +1,6 @@ [] rhel-7.4 +[customGesture] +# QTBUG-67254 +ubuntu +opensuse From e3cf2a1ae959b69957c98f4b9213c4cbc632e888 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Wed, 28 Mar 2018 16:03:20 +0300 Subject: [PATCH 5/6] Blacklist tst_QDnsLookup::lookup Task-number: QTBUG-66311 Change-Id: I8b7536bc11763b8405ecbe5c86be94c2af036c6e Reviewed-by: Ville Voutilainen --- tests/auto/network/kernel/qdnslookup/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/network/kernel/qdnslookup/BLACKLIST diff --git a/tests/auto/network/kernel/qdnslookup/BLACKLIST b/tests/auto/network/kernel/qdnslookup/BLACKLIST new file mode 100644 index 0000000000..f07a8ce9a3 --- /dev/null +++ b/tests/auto/network/kernel/qdnslookup/BLACKLIST @@ -0,0 +1,2 @@ +[lookup] +* From ee6164942d21e7db5b5a6520cb0dbe1b9d631b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Mon, 26 Mar 2018 12:14:50 +0200 Subject: [PATCH 6/6] Allow compilation with clang-cl disguised as cl Task-number: QTBUG-63512 Change-Id: I7e0c4e144262a175c39508090c935c73186fac65 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwin10helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwin10helpers.cpp b/src/plugins/platforms/windows/qwin10helpers.cpp index ac6a34d7c2..5976fd23c0 100644 --- a/src/plugins/platforms/windows/qwin10helpers.cpp +++ b/src/plugins/platforms/windows/qwin10helpers.cpp @@ -43,7 +43,7 @@ #include #include -#if defined(Q_CC_MINGW) +#if defined(Q_CC_MINGW) || defined(Q_CC_CLANG) # define HAS_UI_VIEW_SETTINGS_INTEROP // Present from MSVC2015 + SDK 10 onwards #elif (!defined(Q_CC_MSVC) || _MSC_VER >= 1900) && NTDDI_VERSION >= 0xa000000