diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index f57caa20e..dee90d829 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -546,17 +546,17 @@ std::string ErrorLogger::ErrorMessage::toString(bool verbose, const std::string void ErrorLogger::reportUnmatchedSuppressions(const std::list &unmatched) { // Report unmatched suppressions - for (std::list::const_iterator i = unmatched.begin(); i != unmatched.end(); ++i) { + for (const Suppressions::Suppression &s : unmatched) { // don't report "unmatchedSuppression" as unmatched - if (i->errorId == "unmatchedSuppression") + if (s.errorId == "unmatchedSuppression") continue; // check if this unmatched suppression is suppressed bool suppressed = false; - for (std::list::const_iterator i2 = unmatched.begin(); i2 != unmatched.end(); ++i2) { - if (i2->errorId == "unmatchedSuppression") { - if ((i2->fileName == "*" || i2->fileName == i->fileName) && - (i2->lineNumber == Suppressions::Suppression::NO_LINE || i2->lineNumber == i->lineNumber)) { + for (const Suppressions::Suppression &s2 : unmatched) { + if (s2.errorId == "unmatchedSuppression") { + if ((s2.fileName == "*" || s2.fileName == s.fileName) && + (s2.lineNumber == Suppressions::Suppression::NO_LINE || s2.lineNumber == s.lineNumber)) { suppressed = true; break; } @@ -567,9 +567,9 @@ void ErrorLogger::reportUnmatchedSuppressions(const std::list callStack; - if (!i->fileName.empty()) - callStack.emplace_back(i->fileName, i->lineNumber); - reportErr(ErrorLogger::ErrorMessage(callStack, emptyString, Severity::information, "Unmatched suppression: " + i->errorId, "unmatchedSuppression", false)); + if (!s.fileName.empty()) + callStack.emplace_back(s.fileName, s.lineNumber); + reportErr(ErrorLogger::ErrorMessage(callStack, emptyString, Severity::information, "Unmatched suppression: " + s.errorId, "unmatchedSuppression", false)); } }