MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isComputableValue

Function isComputableValue

lib/vf_settokenvalue.cpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163
164 static bool isComputableValue(const Token* parent, const Value& value)
165 {
166 const bool noninvertible = isNonInvertibleOperation(parent);
167 if (noninvertible && value.isImpossible())
168 return false;
169 if (!value.isIntValue() && !value.isFloatValue() && !value.isTokValue() && !value.isIteratorValue())
170 return false;
171 if (value.isIteratorValue() && !Token::Match(parent, "+|-"))
172 return false;
173 if (value.isTokValue() && (!parent->isComparisonOp() || !Token::Match(value.tokvalue, "{|%str%")))
174 return false;
175 return true;
176 }
177
178 /** Set token value for cast */
179 static bool isCompatibleValueTypes(Value::ValueType x, Value::ValueType y)

Callers 1

setTokenValueFunction · 0.85

Calls 2

isNonInvertibleOperationFunction · 0.85
isImpossibleMethod · 0.80

Tested by

no test coverage detected