From 5628600a07295db6ed6683e97fafb0c45ddea505 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 25 Oct 2023 03:57:14 +0000 Subject: [PATCH] Revert "QWeakPointer: deprecate its relational operators" This reverts commit bb23a05905d7dc0e416a646e40592436daa939f2. Reason for revert: this change resulted in a flood of build-breaking warnings in submodules that need to be cleaned up before we try again. Also, the discussion following this change shows that this needs more clarification of the implications and options. Until that is concluded, the status quo is acceptable. Change-Id: Id8f67ed585517935c31e29d48099b1c84b787b74 Reviewed-by: Fabian Kosmale Reviewed-by: Ulf Hermann --- src/corelib/tools/qsharedpointer_impl.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 1da9a48b60..5dfc4614f9 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -652,36 +652,28 @@ public: // std::weak_ptr compatibility: [[nodiscard]] QSharedPointer lock() const { return toStrongRef(); } -#if QT_DEPRECATED_SINCE(6, 7) template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") bool operator==(const QWeakPointer &o) const noexcept { return d == o.d && value == static_cast(o.value); } template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") bool operator!=(const QWeakPointer &o) const noexcept { return !(*this == o); } template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") bool operator==(const QSharedPointer &o) const noexcept { return d == o.d; } template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") bool operator!=(const QSharedPointer &o) const noexcept { return !(*this == o); } template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") friend bool operator==(const QSharedPointer &p1, const QWeakPointer &p2) noexcept { return p2 == p1; } template - QT_DEPRECATED_VERSION_X_6_7("Comparison of QWeakPointers is inconsistent and may lead to crashes. lock() them and then compare the resulting QSharedPointers.") friend bool operator!=(const QSharedPointer &p1, const QWeakPointer &p2) noexcept { return p2 != p1; } -#endif friend bool operator==(const QWeakPointer &p, std::nullptr_t) { return p.isNull(); }