Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13.1
-
None
-
-
31f07f3114218de758cc8c5b0f5b0d4e83669a5c (qt/qtbase/5.12)
Description
In qhashfunctions.h the code reads as
Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW
{
return qHash(reinterpret_cast<quintptr>(nullptr), seed);
}
but reinterpret_cast<quintptr> cannot be used to cast from a nullptr. It probably should be changed into something like
Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW
{
void* ptr = nullptr;
return qHash(reinterpret_cast<quintptr>(ptr), seed);
}
The current implementation results in a compiler error with the v140 Toolchain of Visual Studio.