Fix QBasicMutex default constructor not constexpr

Commit 02dc39fa8e 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>
This commit is contained in:
Thiago Macieira 2017-11-12 14:15:28 -08:00 committed by Jani Heikkinen
parent 212f92182a
commit 1a05a71493

View File

@ -67,6 +67,12 @@ class QMutexData;
class Q_CORE_EXPORT QBasicMutex class Q_CORE_EXPORT QBasicMutex
{ {
public: public:
#ifdef Q_COMPILER_CONSTEXPR
constexpr QBasicMutex()
: d_ptr(nullptr)
{}
#endif
// BasicLockable concept // BasicLockable concept
inline void lock() QT_MUTEX_LOCK_NOEXCEPT { inline void lock() QT_MUTEX_LOCK_NOEXCEPT {
if (!fastTryLock()) if (!fastTryLock())