diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index a481cc139..cf1ddc97c 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -1203,7 +1203,7 @@ void CheckCondition::alwaysTrueFalse() tok->astParent() && Token::Match(tok->astParent()->astOperand1(), "if|while") && !tok->isBoolean(); - const bool constValExpr = Token::Match(tok, "%num%|%char%") && tok->astParent() && Token::Match(tok->astParent(),"&&|%oror%|?"); // just one number or char in boolean expression + const bool constValExpr = Token::Match(tok, "%num%|%char%") && Token::Match(tok->astParent(),"%oror%|&&|?"); // just one number or char in boolean expression const bool compExpr = Token::Match(tok, "%comp%|!"); // a compare expression if (!(constIfWhileExpression || constValExpr || compExpr))