Fix building qcompare code in MSVC in C++20 mode

MSVC quite incorrectly errors out saying that weak_ordering's
conversion to partial_ordering cannot access the private constructor
that takes the internal order.

The problem goes away when the types are forward-declared before they
are declared as friends.

Fixes: QTBUG-126386
Change-Id: I50ad6d08ee648eb15109dde4a9ec9c753ee18e68
Pick-to: 6.7 6.8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Ville Voutilainen 2024-06-16 16:31:46 +03:00
parent 06b33134b3
commit d2b4aec865

View File

@ -62,6 +62,9 @@ constexpr O reversed(O o) noexcept
namespace Qt {
class weak_ordering;
class strong_ordering;
class partial_ordering
{
public: