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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.0
    • 5.14.1
    • GUI: Font handling
    • None
    • OpenMandriva 4.1, Clang 10.0-rc1
    • All
    • 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.}}

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes