From: Viljar Indus <in...@adacore.com> When a use type clause is used then it makes the type and all of its operators use visible in the context. When analyzing whether a use type clause is effective we should additionally mark the types of an overloaded operator as cases where the use type clause is effective.
gcc/ada/ChangeLog: * sem_ch8.adb (Mark_Use_Type): Additionally mark the types of the parameters and return values as used when analyzing an operator. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch8.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 0a9ef419db7..6fb9a9a1f5a 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -9504,6 +9504,11 @@ package body Sem_Ch8 is and then Present (Scope (Entity (E))) then Mark_Use_Package (Scope (Entity (E))); + + -- Additionally mark the types of the formals and the return + -- types as used when dealing with an overloaded operator. + + Mark_Parameters (Entity (E)); end if; Curr := Current_Use_Clause (Base); -- 2.43.0