diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index d013c26d66b..d2d81475663 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -106,7 +106,8 @@ Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW { - return qHash(reinterpret_cast(nullptr), seed); + const void *ptr = nullptr; // work-around for MSVC's reinterpret_cast bug + return qHash(reinterpret_cast(ptr), seed); } template inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW