PyQt6 build issues with GCC 16, related to operator!=

Phil Thompson phil at riverbankcomputing.com
Thu Aug 13 14:39:11 BST 2026


On 11/08/2026 21:37, Dmitry Shachnev wrote:
> On Tue, Aug 11, 2026 at 08:45:32PM +0100, Phil Thompson wrote:
>> > 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?
>> 
>> That's what SIP used to do many, many years ago. I think it changed to
>> support virtual operators where you need to be able to specify a scope 
>> to
>> make sure the right implementation of the operator is called. However 
>> the
>> problematic operators we know about are defined outside the scope of a 
>> class
>> so I'll change SIP to generate normal comparisons for that subset.
> 
> I just did a quick test, and confirmed that normal comparison will 
> work.
> 
> The attached file fails to compile with:
> 
>     $ g++ -c -std=c++20 $(pkg-config --cflags Qt6Core) test.cpp
>     test.cpp: In function ‘bool inequal(QLocale::Language, const 
> QLocale&)’:
>     test.cpp:5:12: error: ‘operator!=’ not defined
>         5 |     return operator!=(lang, loc);
>           |            ^~~~~~~~~~
> 
> But if you comment line 5 and uncomment line 6, then it compiles fine.

The change is now in the develop branch.

Phil


More information about the PyQt mailing list