QArgumentType: remove the incorrect noexcept from comparison operators

The QArgumentType::name() getter evaluates the name lazily, which also
involves constructing a QMetaType. It's not entirely clear if adding
noexcept there is a good idea, so drop it.

Amends 5a0faa9198c6ae6e21a550159c4284d1a9c5792e.

Change-Id: I73042f22df9615f570823a7745f04e9731c097fe
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e39eb34bc6585c5ec367727e86f70ce67c2d176a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ivan Solovev 2024-08-27 18:24:02 +02:00 committed by Qt Cherry-pick Bot
parent d12b85ae0b
commit cb6a3fe53e

View File

@ -114,14 +114,14 @@ public:
private: private:
friend bool comparesEqual(const QArgumentType &lhs, friend bool comparesEqual(const QArgumentType &lhs,
const QArgumentType &rhs) noexcept const QArgumentType &rhs)
{ {
if (lhs._type && rhs._type) if (lhs._type && rhs._type)
return lhs._type == rhs._type; return lhs._type == rhs._type;
else else
return lhs.name() == rhs.name(); return lhs.name() == rhs.name();
} }
Q_DECLARE_EQUALITY_COMPARABLE(QArgumentType) Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QArgumentType)
int _type; int _type;
QByteArray _name; QByteArray _name;