-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
6.9.2, 6.10.0 Beta3
-
None
Qt build for Windows 32-bit triggers warning C4702 in qhashfunctions.h
C:\Qt\6.9.2\msvc2022_32\include\QtCore\qhashfunctions.h(144,1): warning C4702: unreachable code
This can be fixed here with:
Q_DECL_CONST_FUNCTION constexpr inline size_t qHash(qint64 key, size_t seed = 0) noexcept { if constexpr (sizeof(qint64) > sizeof(size_t)) { // Avoid QTBUG-116080: we XOR the top half with its own sign bit: // - if the qint64 is in range of qint32, then signmask ^ high == 0 // (for Qt 7 only) // - if the qint64 is in range of quint32, then signmask == 0 and we // do the same as the quint64 overload above quint32 high = quint32(quint64(key) >> 32); quint32 low = quint32(quint64(key)); quint32 signmask = qint32(high) >> 31; // all zeroes or all ones signmask = QT_VERSION_MAJOR > 6 ? signmask : 0; low ^= signmask ^ high; return qHash(low, seed); } else { return qHash(quint64(key), seed); } }