Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QCompare: add more relational operator overloads
libc++ has a "poisoned" set of relational operator overloads for the standard category types. A call like std::strong_ordering::equivalent == Qt::partial_ordering::equivalent fails to compile, despite the presence of operator==(std::partial_ordering, Qt::partial_ordering) This is viable after converting strong_ordering. But strong_ordering itself defines a operator==(std::strong_ordering, CmpZero) where CmpZero is poisoned and accepts Qt::partial_ordering, making the call ill-formed. I'm not 100% sure if libc++ is right here (cf. the linked upstream bug report for some ruminations). We can work around this issue by adding sufficient additional overloads to Qt::partial_ordering and be a perfect match. For some reason this was already the case for the other Qt's comparison types. Notes: 1) I didn't test this. Only libc++-trunk defined the necessary C++ feature macros to trigger the problem; I made a synthetic testcase and it worked. 2) I'm not sure why these operators are defined symmetrically instead of relying on C++20's reversed operators, but I'll follow the pre-existing ones. Change-Id: I0937f40b7e685026d4677e7918948d47d2b7cec6 Pick-to: 6.8 6.7 Fixes: QTBUG-126541 Task-number: QTQAINFRA-6203 Reviewed-by: Tatiana Borisova <[email protected]> Reviewed-by: Khem Raj <[email protected]> Reviewed-by: Ivan Solovev <[email protected]>
- Loading branch information