diff --git a/src/libs/clangsupport/filepathstoragesources.h b/src/libs/clangsupport/filepathstoragesources.h index 23293be1f7f..2194e75b955 100644 --- a/src/libs/clangsupport/filepathstoragesources.h +++ b/src/libs/clangsupport/filepathstoragesources.h @@ -82,6 +82,16 @@ public: return !(first == second); } + friend bool operator==(const FileNameEntry &first, const FileNameView &second) + { + return first.directoryId == second.directoryId && first.fileName == second.fileName; + } + + friend bool operator!=(const FileNameEntry &first, const FileNameView &second) + { + return !(first == second); + } + operator FileNameView() const { return {fileName, directoryId}; } operator Utils::SmallString() && { return std::move(fileName); } diff --git a/src/plugins/debugger/peripheralregisterhandler.h b/src/plugins/debugger/peripheralregisterhandler.h index a7f8924113e..a0382d3a58c 100644 --- a/src/plugins/debugger/peripheralregisterhandler.h +++ b/src/plugins/debugger/peripheralregisterhandler.h @@ -82,8 +82,8 @@ class PeripheralRegisterValue final { public: PeripheralRegisterValue(quint64 v = 0) : v(v) {} - bool operator==(const PeripheralRegisterValue &other) { return v == other.v; } - bool operator!=(const PeripheralRegisterValue &other) { return !operator==(other); } + bool operator==(const PeripheralRegisterValue &other) const { return v == other.v; } + bool operator!=(const PeripheralRegisterValue &other) const { return !operator==(other); } bool fromString(const QString &string, PeripheralRegisterFormat fmt); QString toString(int size, PeripheralRegisterFormat fmt) const; diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index bfbf58f57fb..9ddf264ed51 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -238,10 +238,11 @@ void KitManager::restoreKits() kitsToCheck.clear(); // Remove replacement kits for which the original kit has turned up again. - erase(resultList, [&resultList](const std::unique_ptr &k) { - return k->isReplacementKit() && contains(resultList, [&k](const std::unique_ptr &other) { - return other->id() == k->id() && other != k; - }); + Utils::erase(resultList, [&resultList](const std::unique_ptr &k) { + return k->isReplacementKit() + && contains(resultList, [&k](const std::unique_ptr &other) { + return other->id() == k->id() && other != k; + }); }); static const auto kitMatchesAbiList = [](const Kit *kit, const Abis &abis) { diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp index 579fd21649d..93a87b715b2 100644 --- a/src/shared/json/json.cpp +++ b/src/shared/json/json.cpp @@ -1630,7 +1630,7 @@ bool JsonArray::operator==(const JsonArray &other) const return !other.a->length; if (!other.a) return !a->length; - if (a->length != other.a->length) + if (a->length.val != other.a->length.val) return false; for (int i = 0; i < (int)a->length; ++i) { @@ -2594,7 +2594,7 @@ bool JsonObject::operator==(const JsonObject &other) const return !other.o->length; if (!other.o) return !o->length; - if (o->length != other.o->length) + if (o->length.val != other.o->length.val) return false; for (uint32_t i = 0; i < o->length; ++i) { diff --git a/src/tools/clangbackend/source/diagnosticsetiterator.h b/src/tools/clangbackend/source/diagnosticsetiterator.h index 0369e91999d..eb1ceac7a0d 100644 --- a/src/tools/clangbackend/source/diagnosticsetiterator.h +++ b/src/tools/clangbackend/source/diagnosticsetiterator.h @@ -71,12 +71,12 @@ public: return DiagnosticSetIterator(cxTranslationUnit, cxDiagnosticSet, oldIndex); } - bool operator==(const DiagnosticSetIterator &other) + bool operator==(const DiagnosticSetIterator &other) const { return index == other.index && cxDiagnosticSet == other.cxDiagnosticSet; } - bool operator!=(const DiagnosticSetIterator &other) + bool operator!=(const DiagnosticSetIterator &other) const { return index != other.index || cxDiagnosticSet != other.cxDiagnosticSet; }