Skip to content

Commit

Permalink
QMetaType: remove the incorrect noexcept from comparison operators
Browse files Browse the repository at this point in the history
The implementation calls QMetaType::id(), which may call
registerHelper() to register a custom type, and that surely allocates.

Amends 5a0faa9.

Found in 6.8 API Review.

Pick-to: 6.8
Change-Id: I26979379b8fd12c3d52f6489fb25145ac2fa95ed
Reviewed-by: Marc Mutz <[email protected]>
  • Loading branch information
isolovev authored and marcmutz committed Aug 28, 2024
1 parent 92e6508 commit 31d3e57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/corelib/kernel/qmetatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ class Q_CORE_EXPORT QMetaType {
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;
Expand All @@ -527,7 +527,7 @@ class Q_CORE_EXPORT QMetaType {
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);
Expand Down

0 comments on commit 31d3e57

Please sign in to comment.