Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81916

QtGui fails to build in C++20 mode with Clang 10

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.1
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      OpenMandriva 4.1, Clang 10.0-rc1
    • Platform/s:
      All

      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.}}

       

        Attachments

        For Gerrit Dashboard: QTBUG-81916
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            bero Bernhard Rosenkränzer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are 3 open Gerrit changes