From 9f06e0b1f867916bbe69996dc2365c80f59676fc Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Tue, 27 Aug 2024 12:57:07 +0200 Subject: [PATCH] QEasingCurve: remove incorrect noexcept The comparison operators cannot really be noexcept, because they call other non-noexcept getters, like QEasingCurve::amplitude(), QEasingCurve::period(), and QEasingCurve::overshoot(). Amends a4341827ac17c14541ea69c67c76aaae5a09ddcc. Found in 6.8 API reivew. Change-Id: I77c01792adbf7d9a7e36d7efec6defbea866b7d2 Reviewed-by: Marc Mutz (cherry picked from commit 3cf7eff6265b4321e216f830b2ecf1ee4118fad4) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qeasingcurve.cpp | 2 +- src/corelib/tools/qeasingcurve.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 52602a0256e..06369528e88 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1159,7 +1159,7 @@ QEasingCurve::~QEasingCurve() equal; otherwise returns \c false. It will also compare the properties of the curves. */ -bool comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs) noexcept +bool comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs) { bool res = lhs.d_ptr->func == rhs.d_ptr->func && lhs.d_ptr->type == rhs.d_ptr->type; diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h index 61e9aa247d8..d85baa65412 100644 --- a/src/corelib/tools/qeasingcurve.h +++ b/src/corelib/tools/qeasingcurve.h @@ -85,9 +85,9 @@ private: friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &); #endif friend Q_CORE_EXPORT bool - comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs) noexcept; + comparesEqual(const QEasingCurve &lhs, const QEasingCurve &rhs); #if !QT_CORE_REMOVED_SINCE(6, 8) - Q_DECLARE_EQUALITY_COMPARABLE(QEasingCurve) + Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QEasingCurve) #endif }; Q_DECLARE_SHARED(QEasingCurve)