diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 23172e2d8..88b92025e 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1982,7 +1982,7 @@ void CheckOther::checkMisusedScopedObject() && Token::Match(tok->linkAt(2), ") ; !!}") && symbolDatabase->isClassOrStruct(tok->next()->str()) && (!tok->next()->function() || // is not a function on this scope - (tok->next()->function() && tok->next()->function()->isConstructor()))) { // or is function in this scope and it's a ctor + tok->next()->function()->isConstructor())) { // or is function in this scope and it's a ctor tok = tok->next(); misusedScopeObjectError(tok, tok->str()); tok = tok->next(); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 09b27ee08..9750de4b3 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -602,7 +602,7 @@ void Tokenizer::simplifyTypedef() // Skip typedefs inside parentheses (#2453 and #4002) tok = tok->next(); } else if (Token::Match(tok, "class|struct|namespace %any%") && - (!tok->previous() || (tok->previous() && tok->previous()->str() != "enum"))) { + (!tok->previous() || tok->previous()->str() != "enum")) { isNamespace = (tok->str() == "namespace"); hasClass = true; className = tok->next()->str();