mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 03:43:51 +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.
73 lines
239 B
Plaintext
73 lines
239 B
Plaintext
|
|
int:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
uint:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
int8:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
uint8:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
int16:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
uint16:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
int32:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
uint32:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
int64:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
uint64:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
|
|
compare:
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|
|
ok
|