From 1a05a7149358a5b5fb11b1f87a85760cc182a726 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 12 Nov 2017 14:15:28 -0800 Subject: 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) Reviewed-by: Liang Qi --- src/corelib/thread/qmutex.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib/thread') 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()) -- cgit v1.2.3