From 658dfef50085cbf7ac1157528d0ccc2b8a698c34 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 28 Jun 2013 21:52:51 +0200 Subject: Remove default argument from declarations of qHash as friend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's illegal in C++11: §8.3.6.4 [dcl.fct.default] "If a friend declaration specifies a default argument expression, that declaration shall be a definition and shall be the only declaration of the function or function template in the translation unit." Clang is starting to enforce this, thus it's making qtbase not compiling. Task-number: QTBUG-32100 Change-Id: Ifd9d4f62354d7cf4ccf275f36aab64e05c59efff Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Mitch Curtis Reviewed-by: Olivier Goffart --- src/network/kernel/qhostaddress.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network/kernel/qhostaddress.h') diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 77a2ec4105..49032850be 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -64,6 +64,10 @@ public: typedef QIPv6Address Q_IPV6ADDR; +class QHostAddress; +// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) +Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0); + class Q_NETWORK_EXPORT QHostAddress { public: @@ -121,7 +125,7 @@ public: static QPair parseSubnet(const QString &subnet); - friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0); + friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed); protected: QScopedPointer d; }; -- cgit v1.2.3