Ada: Fix valid call to asymmetric "/=" rejected in prefix notation
Corrects an Ada compiler issue where valid asymmetric inequality operators were rejected in prefix notation for tagged types.
This commit resolves an issue in GCC’s Ada front-end where valid calls to asymmetric inequality operators (’/=’) using prefix notation were incorrectly rejected when one operand was a tagged type. The fix redirects the handling of asymmetric inequality operators for tagged types to the common processing path, ensuring correctness and also addresses an inheritance glitch for derived types.
In Details
The Ada compiler's handling of equality operators for tagged types in sem_ch4.adb and sem_ch6.adb was separated from untagged types. This commit corrects the behavior for asymmetric inequality operators ('/=') by directing them to the common processing logic, fixing an issue where they were incorrectly rejected in prefix notation for tagged types. It also rectifies a derived type inheritance problem with implicit inequality operators.
- tagged type
- In Ada, a type that supports dynamic dispatching, allowing operations to be selected at run time based on the object's actual type.
- prefix notation
- An operator notation where the operator precedes its operands, e.g.,
operator(operand1, operand2). - asymmetric equality operators
- In Ada, inequality operators ('<', '>', '/=') that do not necessarily have symmetric behavior.
- derived type
- In Ada, a type that inherits properties from a parent type.