[Ada] Tidy up implementation of Has_Compatible_Type
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Oct 2021 21:51:07 +0000 (23:51 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 9 Nov 2021 09:44:50 +0000 (09:44 +0000)
commit7df3ac2e9ed53f9320a63f38081561166b140cf2
tree2db1cc6bae11c9ffb3005ececb868c8edca6e4a5
parenta2e4ebe02b1be5ee81b24ff504f58ac9078953c0
[Ada] Tidy up implementation of Has_Compatible_Type

gcc/ada/

* sem_ch4.adb (Analyze_Membership_Op) <Find_Interpretation>: Handle
both overloaded and non-overloaded cases.
<Try_One_Interp>: Do a reversed call to Covers if the outcome of the
call to Has_Compatible_Type is false.
Simplify implementation after change to Find_Interpretation.
(Analyze_User_Defined_Binary_Op): Be prepared for previous errors.
(Find_Comparison_Types) <Try_One_Interp>: Do a reversed call to
Covers if the outcome of the call to Has_Compatible_Type is false.
(Find_Equality_Types) <Try_One_Interp>: Likewise.
* sem_type.adb (Has_Compatible_Type): Remove the reversed calls to
Covers.  Add explicit return on all paths.
gcc/ada/sem_ch4.adb
gcc/ada/sem_type.adb