Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.14.1
-
None
-
OpenMandriva 4.1, Clang 10.0-rc1
-
-
95946222e6615cdf731f266530d4dc2db0f28a92
Description
Building Qt 5.14.1 in C++20 mode with Clang 10.0-rc1 fails because of an ambiguous overload in qfontdatabase.cpp. This will likely also be an issue with other compilers as they catch up with C++20 compliance.
{{text/qfontdatabase.cpp:1187:22: error: use of overloaded operator '!=' is ambiguous (with operand types 'QtFontStyle::Key' and 'QtFontStyle::Key') }}
{{ if (styleKey != style->key) }}
{{ ~~~~~~~~ ^ ~~~~~~~~~~ }}
{{text/qfontdatabase.cpp:201:14: note: candidate function }}
{{ bool operator!=(const Key &other) { }}
{{ ^ }}
{{text/qfontdatabase.cpp:197:14: note: candidate function }}
{{ bool operator==(const Key & other) { }}
{{ ^ }}
{{text/qfontdatabase.cpp:197:14: note: candidate function (with reversed parameter order) }}
{{text/qfontdatabase.cpp:1686:46: warning: ISO C++20 considers use of overloaded operator '==' (with operand types 'QtFontStyle::Key' and 'QtFontStyle::Key') to be ambiguous despite there being a unique best viable function [-Wambiguous-reversed-operator] }}
{{ foundry->styles[k]->key == styleKey) }}
{{ ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~ }}
{{text/qfontdatabase.cpp:197:14: note: ambiguity is between a regular call to this operator and a call with the argument order reversed }}
{{ bool operator==(const Key & other) { }}
{{ ^ }}
{{text/qfontdatabase.cpp:1735:46: warning: ISO C++20 considers use of overloaded operator '==' (with operand types 'QtFontStyle::Key' and 'QtFontStyle::Key') to be ambiguous despite there being a unique best viable function [-Wambiguous-reversed-operator] }}
{{ foundry->styles[k]>key == styleKey) && foundry>styles[k]->smoothScalable) { }}
{{ ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~ }}
{{text/qfontdatabase.cpp:197:14: note: ambiguity is between a regular call to this operator and a call with the argument order reversed }}
{{ bool operator==(const Key & other) { }}
{{ ^ }}
{2 warnings and 1 error generated.}}