From aaa74e8f99c91bb877e5f3a8ee4a8b313d2fa133 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 31 Jan 2022 18:16:28 +0100 Subject: [PATCH] QWeakPointer: make default ctor constexpr ... and thereby also QPointer's. Found by applying C++20 constinit around the codebase. Pick-to: 6.3 6.2 Change-Id: I9f149b2346624ca913c29b796f94ac7d24fe560a Reviewed-by: Fabian Kosmale --- src/corelib/tools/qsharedpointer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 7b02ffe50ac..b29de5f79a9 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -571,7 +571,7 @@ public: explicit operator bool() const noexcept { return !isNull(); } bool operator !() const noexcept { return isNull(); } - inline QWeakPointer() noexcept : d(nullptr), value(nullptr) { } + constexpr QWeakPointer() noexcept : d(nullptr), value(nullptr) { } inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; } QWeakPointer(const QWeakPointer &other) noexcept : d(other.d), value(other.value)