Summary: | [GLIB] Build error in GraphicsContextState.cpp (error: no match for 'operator!=') in Ubuntu LTS after r291696 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Diego Pino <dpino> | ||||||
Component: | New Bugs | Assignee: | Diego Pino <dpino> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aperez, lmoura, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Diego Pino
2022-03-28 03:45:14 PDT
Created attachment 455896 [details]
Patch
Comment on attachment 455896 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455896&action=review > Source/WebCore/platform/graphics/GraphicsTypes.h:90 > +} This cannot work, moving the function outside of the “class” block means that now there is no implicit “this”, and that no operator== is defined at all for CompositeMode. You need to leave this one as it was. Created attachment 455903 [details]
Patch
The build error from the Ubuntu LTS build bot was: ``` Source/WebCore/platform/graphics/GraphicsContextState.cpp:60:84: error: no match for ‘operator!=’ (operand types are ‘const WebCore::CompositeMode’ and ‘WebCore::CompositeMode’) 60 | changeFlags.set(change, !lastDrawingState || (*lastDrawingState).*property != this->*property); ``` https://build.webkit.org/#/builders/68/builds/12304/steps/8/logs/stdio Committed r291970 (248935@main): <https://commits.webkit.org/248935@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455903 [details]. FTR, this seems to be related to changes to the C++20 equality/spaceship operators in GCC 10 Sample godbolt: https://godbolt.org/z/GWen331rM GCC C++20 support: https://gcc.gnu.org/projects/cxx-status.html#cxx20 Especially the following spec, first supported in gcc10: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1185r2.html#wording > A defaulted != operator function for a class C with parameters x and y is defined as deleted if > (snip list of cases where != would be deleted.) > Otherwise, the operator function yields (x == y) ? false : true if an operator == with the original order of parameters was selected, or (y == x) ? false : true otherwise. So, GCC >10 correctly defined the defaulted `!=` operator, while older GCC's needed them to be explicitly defined (like the patch did), as it did not implement this behavior. |