From 1a8f43e02bf86aa37f07129e01b81444d2c57550 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 14 Jan 2025 14:33:36 +0100 Subject: [PATCH] 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 --- src/libs/qmljs/persistenttrie.cpp | 4 ++-- src/libs/qmljs/persistenttrie.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/qmljs/persistenttrie.cpp b/src/libs/qmljs/persistenttrie.cpp index d41c5d2443e..6c604882490 100644 --- a/src/libs/qmljs/persistenttrie.cpp +++ b/src/libs/qmljs/persistenttrie.cpp @@ -583,12 +583,12 @@ bool Trie::isEmpty() const 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); } -bool Trie::operator!=(const Trie &o) +bool Trie::operator!=(const Trie &o) const { return !TrieNode::isSame(trie,o.trie); } diff --git a/src/libs/qmljs/persistenttrie.h b/src/libs/qmljs/persistenttrie.h index f9457723c4b..f0e52a2662b 100644 --- a/src/libs/qmljs/persistenttrie.h +++ b/src/libs/qmljs/persistenttrie.h @@ -73,8 +73,8 @@ public: void replace(const QHash &replacements); bool isEmpty() const; - bool operator==(const Trie &o); - bool operator!=(const Trie &o); + bool operator==(const Trie &o) const; + 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 Trie &trie);