Refactorings. Use reportError instead of reportInconclusiveError.
This commit is contained in:
parent
009471f4ee
commit
4abee3a345
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue