summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-11-12 14:15:28 -0800
committerJani Heikkinen <jani.heikkinen@qt.io>2017-11-14 04:55:24 +0000
commit1a05a7149358a5b5fb11b1f87a85760cc182a726 (patch)
treeb07ccfeaf715bfe3654a14d8676fd41000f7fa5e /src/corelib
parent212f92182ad468ec93472ed93ae3839f7122cb68 (diff)
Fix QBasicMutex default constructor not constexpr
Commit 02dc39fa8ee6fd9945728e12208a9e313ac4dd4b added the constructor for the bootstrapped mode. For the regular mode, we hadn't needed, since the {} syntax guaranteed initialization for us. Turns out there's at least one compiler that doesn't think it was enough (GCC for QNX 7). Task-number: QTBUG-64451 Change-Id: Ic632b4163d784b83951cfffd14f6766b4cb4eb64 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qmutex.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 607cc13a2f..3d24379fa9 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -67,6 +67,12 @@ class QMutexData;
class Q_CORE_EXPORT QBasicMutex
{
public:
+#ifdef Q_COMPILER_CONSTEXPR
+ constexpr QBasicMutex()
+ : d_ptr(nullptr)
+ {}
+#endif
+
// BasicLockable concept
inline void lock() QT_MUTEX_LOCK_NOEXCEPT {
if (!fastTryLock())