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

[REG SiC 6.4 -> 6.5] qHash(qfloat16(x)) is now ambiguous on GCC13

    XMLWordPrintable

Details

    • 2
    • c86cf385d (dev), 2d4db1bff (6.5), 3a9bbf235 (6.6), 6da6a17de (dev), e8fb761f7 (6.6), eb5be509d (6.5), 0f19cafc3 (dev), 8e14e13c1 (6.6), 3974778dc (6.5), fdfbb6106 (6.5.3), 096a11225 (6.6.0)
    • Foundation Sprint 90

    Description

      This code worked fine on GCC 13 up to Qt 6.4, but breaks in Qt 6.5:

      auto h = qHash(qfloat16(-42.f));
      

      In Qt 6.5, it breaks with the following error:

      tst.cpp:5:19: error: call of overloaded ‘qHash(qfloat16)’ is ambiguous
          5 |   return int(qHash(qfloat16(-42.0f)));
            |              ~~~~~^~~~~~~~~~~~~~~~~~
      

      It goes on to list all the qHash() overloads, incl. the three FP ones: float, double, long double. It seems it no longer prefers the float overload.

      Attachments

        1. tst.cpp
          0.1 kB
        2. tst.pro
          0.0 kB

        Issue Links

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

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: