summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-22 14:55:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-24 12:47:56 +0000
commit7216a4a2afe303451472acc8a6e5d06108720a78 (patch)
tree7f95114f1bc36b876faed987a06d11f65b111d56
parent374a3f67c4983a920a6b4dbdcabdd6c273cfa806 (diff)
downloadqtdeclarative-7216a4a2afe303451472acc8a6e5d06108720a78.tar.gz
QQmlJS::Dom::PathIterator: fix relational operators in C++20 mode
The missing const makes operator==(const X&) (aka op==(X&, const X&)) and its automatically reversed version (operator==(const X&, X&)) ambiguous. Ditto op!=. Fix by making them const. Change-Id: I8ea17f8d36984bd4f9eaa2f195df6b9408aba618 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9585d6bcb709df83fbadca3fe0a970c47f88ce22) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qmldom/qqmldompath_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qmldom/qqmldompath_p.h b/src/qmldom/qqmldompath_p.h
index 50508a469d..f0fddcabea 100644
--- a/src/qmldom/qqmldompath_p.h
+++ b/src/qmldom/qqmldompath_p.h
@@ -772,8 +772,8 @@ public:
Path operator *() const { return currentEl.head(); }
PathIterator operator ++() { currentEl = currentEl.dropFront(); return *this; }
PathIterator operator ++(int) { PathIterator res{currentEl}; currentEl = currentEl.dropFront(); return res; }
- bool operator ==(const PathIterator &o) { return currentEl == o.currentEl; }
- bool operator !=(const PathIterator &o) { return currentEl != o.currentEl; }
+ bool operator ==(const PathIterator &o) const { return currentEl == o.currentEl; }
+ bool operator !=(const PathIterator &o) const { return currentEl != o.currentEl; }
};
class Source {