summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qcompare
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-11-29 19:57:52 +0100
committerIvan Solovev <ivan.solovev@qt.io>2023-12-07 23:36:14 +0100
commita0ae96e3e74d825bc77caa0f54d41c344afe4aa5 (patch)
tree6738226f4d0af499853598298c4c091b7db3dc9a /tests/auto/corelib/global/qcompare
parent39c7bf4631b401c681c24bb5a732a0359c8a6d7c (diff)
QPartialOrdering: add missing conversion from std::{weak,strong}_ordering
QPartialOrdering is suppsed to be a drop-in replacement for std::partial_ordering, so it has to be convertible from all std::_ordering types. It was, however, only convertible from std::partial_ordering, and two user-defined conversions in a row are not allowed. Add the missing constructors. They, in turn, can then delegate to the partial_ordering constructor. Change-Id: I085d95677b258b4a61aabfd5468c1c43c2212766 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/qcompare')
-rw-r--r--tests/auto/corelib/global/qcompare/tst_qcompare.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qcompare/tst_qcompare.cpp b/tests/auto/corelib/global/qcompare/tst_qcompare.cpp
index f07b2b8910..f473c1706d 100644
--- a/tests/auto/corelib/global/qcompare/tst_qcompare.cpp
+++ b/tests/auto/corelib/global/qcompare/tst_qcompare.cpp
@@ -144,6 +144,8 @@ void tst_QCompare::legacyConversions()
static_assert(QPartialOrdering::Unordered == NS ::partial_ordering::unordered); \
\
CHECK_CONVERTS(NS ::partial_ordering, QPartialOrdering); \
+ CHECK_CONVERTS(NS ::weak_ordering, QPartialOrdering); \
+ CHECK_CONVERTS(NS ::strong_ordering, QPartialOrdering); \
} while (false)
#ifdef __cpp_lib_three_way_comparison