equal7_pkg.ads
554 Bytes
-
[Ada] Wrong resolution of equality operator with overloaded operand · 0ce85831
This patch fixes a code generation error on an equality operation one of whose operands is an overloaded call, and several equality operators are visible. The resolution would succes but in some cases the wrong entity was lwfton the equality node, leading to expansion with the wrong interpretation. If the equality operation is the operand of a negation, the resolution of the negation must make direct use of the equality resolution, 2019-07-09 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Equality_Op): If the node was overloaded, set properly the entity to which the node has been resolved. The original entity is the first one found during analysis, and is not necessarily the resolved one. (Resolve_Op_Not): If the argument of negation is an overloaded equality operation, call its resolution directly given that the context type does not participate in overload resolution. gcc/testsuite/ * gnat.dg/equal7.adb, gnat.dg/equal7_pkg.adb, gnat.dg/equal7_pkg.ads: New testcase. From-SVN: r273281
Ed Schonberg committed