C++: isConstant() -> exists(getValue())

This code was clearly using `isConstant` as an indirect way of checking
whether `getValue` would have a result. That's no longer valid, so I
changed it to check `getValue` directly.
This commit is contained in:
Jonas Jensen
2019-01-15 19:03:49 +01:00
parent d81e6e9bb8
commit b3f46d757a

View File

@@ -43,7 +43,7 @@ string comparisonOnLiterals(ComparisonOperation op) {
simple(op.getLeftOperand()) and
simple(op.getRightOperand()) and
not op.getAnOperand().isInMacroExpansion() and
if op.isConstant()
if exists(op.getValue())
then result = "This comparison involves two literals and is always " + op.getValue() + "."
else result = "This comparison involves two literals and should be simplified."
}