From 31d3e57342161a9a8edaebacb968950e6a16d67e Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Tue, 27 Aug 2024 18:17:41 +0200 Subject: [PATCH] QMetaType: remove the incorrect noexcept from comparison operators The implementation calls QMetaType::id(), which may call registerHelper() to register a custom type, and that surely allocates. Amends 5a0faa9198c6ae6e21a550159c4284d1a9c5792e. Found in 6.8 API Review. Pick-to: 6.8 Change-Id: I26979379b8fd12c3d52f6489fb25145ac2fa95ed Reviewed-by: Marc Mutz --- src/corelib/kernel/qmetatype.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index f3dee0433b2..64daf5e0127 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -516,7 +516,7 @@ public: static QMetaType fromName(QByteArrayView name); private: friend bool comparesEqual(const QMetaType &lhs, - const QMetaType &rhs) noexcept + const QMetaType &rhs) { if (lhs.d_ptr == rhs.d_ptr) return true; @@ -527,7 +527,7 @@ private: const int bId = rhs.id(); return aId == bId; } - Q_DECLARE_EQUALITY_COMPARABLE(QMetaType) + Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QMetaType) #ifndef QT_NO_DEBUG_STREAM private: friend Q_CORE_EXPORT QDebug operator<<(QDebug d, QMetaType m);