mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 21:03:53 +00:00
Newer versions of gcc and clang may warn about comparison of a variable
to itself that always evaluate to true or false, breaking builds in
which warnings are treated as errors.
compiler/simplify_goal_call.m:
Replace calls to comparison predicates < > =< >= of int types in
which both arguments are the same variable with 'true' or 'false'
goals.
Replace calls to builtin.compare/3 where the compared arguments are
the same variable with a goal that assigns (=) as the comparison
result.
Factor out common simplifications to all int types.
tests/hard_coded/Mmakefile:
tests/hard_coded/tautological_compare.m:
tests/hard_coded/tautological_compare.exp:
Add new test case.
tests/typeclasses/typeclass_exist_method.m:
Revert now-unnecessary workaround.