From a0ae96e3e74d825bc77caa0f54d41c344afe4aa5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 29 Nov 2023 19:57:52 +0100 Subject: 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 --- tests/auto/corelib/global/qcompare/tst_qcompare.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/corelib/global/qcompare') 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 -- cgit v1.2.3