QSharedPointer: fix counter-productive QT_PREPEND_NAMESPACE use in qHash() impl

The qHash(QSharedPointer) implementation is already in QT_NAMESPACE,
if any, so explicitly qualifying the call adds no functions to the
overload set, but actually removes functions that would be found by ADL
(which is only enabled for unqualified calls).

Fix by using an unqualified call.

[ChangeLog][QtCore][QSharedPointer] The qHash(QSharedPointer<X>)
overload can now use qHash(X*) overloads found (only) through ADL
(was: ADL was disabled due to qualified lookup of qHash(X*)).

Pick-to: 6.2 5.15
Change-Id: Ic6cc47103142d48b6cdefa2cd6552a65cf1cb222
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2021-11-26 16:07:24 +01:00
parent 24134d5193
commit 23f980799d

View File

@ -801,7 +801,7 @@ Q_INLINE_TEMPLATE bool operator<(T *ptr1, const QSharedPointer<X> &ptr2)
template <class T>
Q_INLINE_TEMPLATE size_t qHash(const QSharedPointer<T> &ptr, size_t seed = 0)
{
return QT_PREPEND_NAMESPACE(qHash)(ptr.data(), seed);
return qHash(ptr.data(), seed);
}