Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2, 6.5, 6.7, 6.8
-
None
-
3
-
fed1099ad (dev), d39441a2e (dev), 247ec89cc (6.8), a83d113f6 (6.8), f1cc1f13d (6.7), 82e23d266 (6.7), b40f9b8c3 (tqtc/lts-6.5), a76ed16a8 (tqtc/lts-6.5), 0718845d3 (tqtc/lts-6.2), ff8fecc4b (tqtc/lts-6.2)
-
Foundation Sprint 113, Foundation Sprint 114
Description
The inequality operator in Qt::partial_ordering (or QPartialOrdering in earlier versions) is implemented as follows:
friend constexpr bool operator!=(partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept { return lhs.isOrdered() && lhs.m_order != 0; }
This operator incorrectly demands that the lhs value is ordered. However, unordered values are always not-equal to any other values, so we can skip the isOrdered() check here.
The test would be:
float nan = std::numeric_limits<float>::quiet_NaN(); const auto r = Qt::compareThreeWay(nan, 1.f); QVERIFY(r != 0); // FAILS now