From 5381f6c8773e00f6dee998ddfa9d8b711c45413a Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 1 Oct 2021 09:45:54 +0200 Subject: [PATCH] Remove QWeakPointer::operator-> operator-> was only defined if QWEAKPOINTER_ENABLE_ARROW is defined. However, even in that case it would call QWeakPointer::data, which does not actually exist. Take this as an indicator that nobody actually uses operator->, and remove the code completely. Note that the QWEAKPOINTER_ENABLE_ARROW was not documented, and neither was operator->. Change-Id: I2f4aa961a64281542c8c1b248a993e83471c059d Reviewed-by: Lars Knoll Reviewed-by: Qt CI Bot --- src/corelib/tools/qsharedpointer_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 0db62d9ef4..0e69c18ca4 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -634,10 +634,6 @@ public: // std::weak_ptr compatibility: inline QSharedPointer lock() const { return toStrongRef(); } -#if defined(QWEAKPOINTER_ENABLE_ARROW) - inline T *operator->() const { return data(); } -#endif - template bool operator==(const QWeakPointer &o) const noexcept { return d == o.d && value == static_cast(o.value); }