summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qjsonobject.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-08-27 10:30:24 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-08-28 13:07:20 +0000
commit7f01b62969d1734832ead0547904902ae0f1b5dd (patch)
treef27d4fb27ce5378ded35f70387f6b8d91220d3b1 /src/corelib/serialization/qjsonobject.cpp
parent495a06a22aef2aa62dd993217e4f4ec099ad4e94 (diff)
serialization: remove incorrect noexcept on comparison operators [1/2]
QJsonValue comparison cannot be noexcept, because it might allocate, for example when calling QCborValue::toString(). As a result, all the QJsonValue(Const)Ref comparison operators also cannot be noexcept, because they convert to QJsonValue to do the comparison. QJsonObject comparison cannot be noexcept, because it might call QCborValue::makeValue(), which might allocate. QJsonArray comparison cannot be noexcept, because it might also call QCborValue::makeValue(), which might allocate. Found in 6.8 API review. Pick-to: 6.8 Change-Id: I775746b2a76765bca26b87d5af396a8dfdfca7f9 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qjsonobject.cpp')
-rw-r--r--src/corelib/serialization/qjsonobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp
index 2f61de08243..12d175b8e0d 100644
--- a/src/corelib/serialization/qjsonobject.cpp
+++ b/src/corelib/serialization/qjsonobject.cpp
@@ -621,7 +621,7 @@ bool QJsonObject::containsImpl(T key) const
Returns \c true if \a lhs object is equal to \a rhs, \c false otherwise.
*/
-bool comparesEqual(const QJsonObject &lhs, const QJsonObject &rhs) noexcept
+bool comparesEqual(const QJsonObject &lhs, const QJsonObject &rhs)
{
if (lhs.o == rhs.o)
return true;