diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 6c9203809..8bc2c01c5 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -768,7 +768,7 @@ void CheckClass::operatorEq() void CheckClass::operatorEqReturnError(const Token *tok, const std::string &className) { - reportInconclusiveError(tok, Severity::style, "operatorEq", "\'" + className + "::operator=' should return \'" + className + " &\'"); + reportError(tok, Severity::style, "operatorEq", "\'" + className + "::operator=' should return \'" + className + " &\'"); } //--------------------------------------------------------------------------- @@ -1067,9 +1067,9 @@ void CheckClass::virtualDestructor() } // Assign base class pointer with pointer to derived class instance - if (Token::Match(tok, "[;{}] %var% =") && - tok->next()->varId() > 0 && - basepointer.find(tok->next()->varId()) != basepointer.end()) { + else if (Token::Match(tok, "[;{}] %var% =") && + tok->next()->varId() > 0 && + basepointer.find(tok->next()->varId()) != basepointer.end()) { // new derived class.. if (Token::simpleMatch(tok->tokAt(3), ("new " + derivedClass->str()).c_str())) { dontDelete.insert(tok->next()->varId()); @@ -1077,9 +1077,9 @@ void CheckClass::virtualDestructor() } // Delete base class pointer that might point at derived class - if (Token::Match(tok, "delete %var% ;") && - tok->next()->varId() && - dontDelete.find(tok->next()->varId()) != dontDelete.end()) { + else if (Token::Match(tok, "delete %var% ;") && + tok->next()->varId() && + dontDelete.find(tok->next()->varId()) != dontDelete.end()) { ok = false; break; } diff --git a/lib/checkother.cpp b/lib/checkother.cpp index cbd7cd0f0..0597de815 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2359,10 +2359,10 @@ void CheckOther::duplicateBranchError(const Token *tok1, const Token *tok2) toks.push_back(tok2); toks.push_back(tok1); - reportInconclusiveError(toks, Severity::style, "duplicateBranch", "Found duplicate branches for if and else.\n" - "Finding the same code for an if branch and an else branch is suspicious and " - "might indicate a cut and paste or logic error. Please examine this code " - "carefully to determine if it is correct."); + reportError(toks, Severity::style, "duplicateBranch", "Found duplicate branches for if and else.\n" + "Finding the same code for an if branch and an else branch is suspicious and " + "might indicate a cut and paste or logic error. Please examine this code " + "carefully to determine if it is correct."); } namespace {