From 01d94760d8d34e51e1442682fc151747943c7e25 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 21 Sep 2021 11:13:06 +0200 Subject: [PATCH] tst_qmetatype: Fix operator< detection for std::optional Amends ca54b741d6edda24773137aacee229db31dd3585. operator< is not constrained in MSVC's standard library, either. Pick-to: 6.2 Fixes: QTBUG-96690 Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f Reviewed-by: Lars Knoll --- src/corelib/global/qtypeinfo.h | 2 ++ tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 2729217aabe..7759eff370b 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -311,6 +311,8 @@ using expand_operator_less_than_recursive = std::conjunction struct expand_operator_less_than_tuple : has_operator_less_than {}; +template +struct expand_operator_less_than_tuple> : has_operator_less_than {}; template struct expand_operator_less_than_tuple> : expand_operator_less_than_recursive {}; template diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 09a51258863..66040228b4f 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -130,7 +130,9 @@ static_assert(!QTypeTraits::has_operator_less_than_v> // std::optional static_assert(QTypeTraits::has_operator_equal_v>); +static_assert(QTypeTraits::has_operator_less_than_v>); static_assert(!QTypeTraits::has_operator_equal_v>); +static_assert(!QTypeTraits::has_operator_less_than_v>); // nested types static_assert(QTypeTraits::has_operator_equal_v);