From 373845dfd8acae0c941432c8cd615b77bcae0a2a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 2 Aug 2012 15:51:52 +0200 Subject: Add Q_DECL_NOTHROW to some qHash functions The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/network/kernel/qhostaddress.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/network') diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index 3ca0f84c39..310315e636 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -1031,6 +1031,7 @@ QDebug operator<<(QDebug d, const QHostAddress &address) uint qHash(const QHostAddress &key, uint seed) { + // both lines might throw QT_ENSURE_PARSED(&key); return qHash(QByteArray::fromRawData(reinterpret_cast(key.d->a6.c), 16), seed); } -- cgit v1.2.3