]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Mark the types of operator arguments as used
authorViljar Indus <indus@adacore.com>
Thu, 9 Jan 2025 10:37:56 +0000 (12:37 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 5 Jun 2025 08:18:34 +0000 (10:18 +0200)
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.

gcc/ada/sem_ch8.adb

index 0a9ef419db786b0fb2ed545e2ec3f7164d1228e9..6fb9a9a1f5a7ab91c428b264c5c303e3ce32aae5 100644 (file)
@@ -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);