summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qabstractitemmodel.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-06-28 21:52:51 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-02 13:34:56 +0200
commit658dfef50085cbf7ac1157528d0ccc2b8a698c34 (patch)
tree6a8c2897a201d35f3d57ac61a468a2f5c6977438 /src/corelib/itemmodels/qabstractitemmodel.h
parent6177a3026b3392de43a19e5be213baf7b22c9a3c (diff)
Remove default argument from declarations of qHash as friend
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 <tmartsum@gmail.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/itemmodels/qabstractitemmodel.h')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index 215ccce44d..f3bf2c1019 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -98,6 +98,9 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &);
class QPersistentModelIndexData;
+// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
+uint qHash(const QPersistentModelIndex &index, uint seed = 0);
+
class Q_CORE_EXPORT QPersistentModelIndex
{
public:
@@ -128,7 +131,7 @@ public:
bool isValid() const;
private:
QPersistentModelIndexData *d;
- friend uint qHash(const QPersistentModelIndex &, uint seed = 0);
+ friend uint qHash(const QPersistentModelIndex &, uint seed);
#ifndef QT_NO_DEBUG_STREAM
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
#endif