QmlJS: Silence c++20 warning

On older macOS SDKs the missing const ends up in a
warning regarding ambiguous reversed operators.

Change-Id: Ic71e68e2360ff60326746a2aea599ffe8969fc99
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2025-01-14 14:33:36 +01:00
parent 0c89e5ac5e
commit 1a8f43e02b
2 changed files with 4 additions and 4 deletions

View File

@@ -583,12 +583,12 @@ bool Trie::isEmpty() const
return trie.isNull(); // assuming to never generate an empty non null trie return trie.isNull(); // assuming to never generate an empty non null trie
} }
bool Trie::operator==(const Trie &o) bool Trie::operator==(const Trie &o) const
{ {
return TrieNode::isSame(trie,o.trie); return TrieNode::isSame(trie,o.trie);
} }
bool Trie::operator!=(const Trie &o) bool Trie::operator!=(const Trie &o) const
{ {
return !TrieNode::isSame(trie,o.trie); return !TrieNode::isSame(trie,o.trie);
} }

View File

@@ -73,8 +73,8 @@ public:
void replace(const QHash<QString, QString> &replacements); void replace(const QHash<QString, QString> &replacements);
bool isEmpty() const; bool isEmpty() const;
bool operator==(const Trie &o); bool operator==(const Trie &o) const;
bool operator!=(const Trie &o); bool operator!=(const Trie &o) const;
friend QMLJS_EXPORT QDebug operator<<(QDebug dbg, const TrieNode::Ptr &trie); friend QMLJS_EXPORT QDebug operator<<(QDebug dbg, const TrieNode::Ptr &trie);
friend QMLJS_EXPORT QDebug operator<<(QDebug dbg, const Trie &trie); friend QMLJS_EXPORT QDebug operator<<(QDebug dbg, const Trie &trie);