diff options
authorMarc Mutz <>2021-11-26 16:07:24 +0100
committerMarc Mutz <>2021-11-27 01:37:06 +0000
commit23f980799d03f1522b6c7f87c2018566bcb6c996 (patch)
parent24134d519342fdc5d05d3fe0a4b088e8ebc41d29 (diff)
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 <> Reviewed-by: MÃ¥rten Nordheim <>
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index fa91719709..61aeee4952 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -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)(, seed);
+ return qHash(, seed);