Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.2, 6.6.0 Beta2, dev
-
None
-
Ubuntu 20.04, GCC 13 (but probably every compiler that natively supports f16).
-
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
Issue Links
- relates to
-
QTBUG-116077 Inconsistent hashing between different FP types
- Reported
-
QTBUG-116076 qHash(qfloat16(x), seed) != qHash(float(x), seed) unless seed == 0
- Closed
-
QTBUG-116080 Inconsistent hashing between qint{32,64} on 32-bit platforms
- Closed
-
QTBUG-126674 Inconsistent hashing between bool and integral overloads
- Closed
For Gerrit Dashboard: QTBUG-116064 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
496753,3 | tst_QHashFunctions: extend the consistency() test with int/FP types | dev | qt/qtbase | Status: MERGED | +2 | 0 |
497081,2 | tst_QHashFunctions: extend the consistency() test with int/FP types | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
497082,2 | tst_QHashFunctions: extend the consistency() test with int/FP types | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
503188,4 | Fix qHash(qfloat16) to match Qt 6.4 behavior | dev | qt/qtbase | Status: MERGED | +2 | 0 |
503546,2 | Fix qHash(qfloat16) to match Qt 6.4 behavior | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
503577,2 | Fix qHash(qfloat16) to match Qt 6.4 behavior | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
504567,3 | [docs] Fix \since for qHash(qfloat16) | dev | qt/qtbase | Status: MERGED | +2 | 0 |
505193,2 | [docs] Fix \since for qHash(qfloat16) | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
505395,2 | [docs] Fix \since for qHash(qfloat16) | 6.6.0 | qt/qtbase | Status: MERGED | +2 | 0 |
505396,2 | [docs] Fix \since for qHash(qfloat16) | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
505438,2 | [docs] Fix \since for qHash(qfloat16) | 6.5.3 | qt/qtbase | Status: MERGED | +2 | 0 |