We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
hasKnownIntValue()
1 parent de3203b commit cbcca15Copy full SHA for cbcca15
lib/checkcondition.cpp
@@ -1699,7 +1699,7 @@ void CheckCondition::checkInvalidTestForOverflow()
1699
const Token * const other = expr->astSibling();
1700
1701
// x [+-] c cmp x
1702
- if ((other->isNumber() && other->getKnownIntValue() > 0) ||
+ if ((other->isNumber() && other->hasKnownIntValue() && other->getKnownIntValue() > 0) ||
1703
(!other->isNumber() && other->valueType() && other->valueType()->isIntegral() && other->valueType()->sign == ValueType::Sign::UNSIGNED)) {
1704
bool result;
1705
if (lhs->str() == "+")
0 commit comments