[Ada] Fix oversight in latest change to Has_Compatible_Type

Pierre-Marie de Rodat derodat@adacore.com
Wed Nov 10 08:58:33 GMT 2021

Adding manual calls to Covers in the callers overlooks the overloaded case,
so this follow-up change adds back the reversed calls to Has_Compatible_Type
but guard them with a boolean flag set to true for comparison operators.

Tested on x86_64-pc-linux-gnu, committed on trunk


	* sem_type.ads (Has_Compatible_Type): Add For_Comparison parameter.
	* sem_type.adb (Has_Compatible_Type): Put back the reversed calls
	to Covers guarded with For_Comparison.
	* sem_ch4.adb (Analyze_Membership_Op) <Try_One_Interp>: Remove new
	reversed call to Covers and set For_Comparison to true instead.
	(Find_Comparison_Types) <Try_One_Interp>: Likewise
	(Find_Equality_Types) <Try_One_Interp>: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3945 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211110/4502d823/attachment-0001.bin>

More information about the Gcc-patches mailing list