Fix compilation issue with clang in C++11 mode.
authorErik Verbruggen <erik.verbruggen@digia.com>
Thu, 8 Nov 2012 09:10:40 +0000 (10:10 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 16:15:34 +0000 (17:15 +0100)
As with all other qHash functions, providing a default value for the
seed is needed.

Compiler error:

In file included from qml/v8/qv8engine.cpp:42:
In file included from qml/v8/qv8engine_p.h:57:
In file included from /Users/erik/dev/qt5-stable/qtbase/include/QtCore/qvariant.h:1:
In file included from /Users/erik/dev/qt5-stable/qtbase/include/QtCore/../../src/corelib/kernel/qvariant.h:50:
In file included from /Users/erik/dev/qt5-stable/qtbase/include/QtCore/qhash.h:1:
/Users/erik/dev/qt5-stable/qtbase/include/QtCore/../../src/corelib/tools/qhash.h:107:35: error: no matching function for call to 'qHash'
    Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

[skipping macro expansion and candidate qHash functions]

qml/v8/qv8engine_p.h:89:13: note: candidate function not viable: requires 2 arguments, but 1 was provided
inline uint qHash(const v8::Handle<v8::Object> &object, uint seed)

Change-Id: I917785ce5ce596757fe06ced1536797090bb0f77
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
src/qml/qml/v8/qv8engine_p.h

index 1c107bd..8320a89 100644 (file)
@@ -86,7 +86,7 @@
 namespace v8 {
 
 // Needed for V8ObjectSet
-inline uint qHash(const v8::Handle<v8::Object> &object, uint seed)
+inline uint qHash(const v8::Handle<v8::Object> &object, uint seed = 0)
 {
     return (object->GetIdentityHash() ^ seed);
 }