PyQt6 build issues with GCC 16, related to operator!=
Dmitry Shachnev
mitya57 at ubuntu.com
Tue Aug 11 20:04:49 BST 2026
Hi Phil!
On Tue, Aug 11, 2026 at 04:25:04PM +0100, Phil Thompson wrote:
> A C++ expert could probably help...
>
> - the generated code has been working fine for years and years and still
> does with other compilers and older versions of GCC
> - the problems only seem to be with operator!= and not operator==
> - GCC v16 defaults to -std=c++20
>
> The QLocale code expects the corresponding convertor ctor to be invoked
> automatically. I've changed the code (tonight's snapshot) to call the ctor
> explicitly - see if that improves things.
>
> I am at a loss with the QWebEngineFrame code which doesn't use any implicit
> conversions. I've tried building with clang++ with -std=c++20 - no problems.
It looks like the snapshot is not published yet, so I will test it later.
You are right, this problem looks related to C++20, in particular with
the new comparison system: <https://www.qt.io/blog/c20-comparisons-in-qt>.
That blog post says:
> comparesEqual() is used to implement operator==() in C++20 and also
> operator!=() in C++17.
So if I understand it correctly, there is no explicit operator!= with C++20
anymore, only the <=> operator.
I think if we use normal comparison (a != b) instead of explicitly calling
the operator (operator!=(a, b)), then it should work fine. Can SIP generate
that?
--
Dmitry Shachnev
More information about the PyQt
mailing list