https://gcc.gnu.org/g:78551d9e13a20a281546cdb5f6feaa336d5951bd

commit r16-3860-g78551d9e13a20a281546cdb5f6feaa336d5951bd
Author: Ronan Desplanques <[email protected]>
Date:   Tue Aug 26 15:39:03 2025 +0200

    ada: Fix documentation of Is_Ancestor_Package
    
    "Is_Ancestor_Package (E, E)" returns True and this patch fixes a comment
    that claimed otherwise. This patch also renames an object local to
    Is_Ancestor_Package that was misleadingly named "Par", a common
    abbreviation of "Parent".
    
    gcc/ada/ChangeLog:
    
            * sem_util.ads (Is_Ancestor_Package): Fix documentation comment.
            * sem_util.adb (Is_Ancestor_Package): Rename local object.

Diff:
---
 gcc/ada/sem_util.adb | 8 ++++----
 gcc/ada/sem_util.ads | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 8a3998d7d123..432b036396d7 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -15991,14 +15991,14 @@ package body Sem_Util is
      (E1 : Entity_Id;
       E2 : Entity_Id) return Boolean
    is
-      Par : Entity_Id := E2;
+      Cursor : Entity_Id := E2;
    begin
-      while Present (Par) and then Par /= Standard_Standard loop
-         if Par = E1 then
+      while Present (Cursor) and then Cursor /= Standard_Standard loop
+         if Cursor = E1 then
             return True;
          end if;
 
-         Par := Scope (Par);
+         Cursor := Scope (Cursor);
       end loop;
 
       return False;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 04caed575065..88a1841cb389 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1849,7 +1849,7 @@ package Sem_Util is
    function Is_Ancestor_Package
      (E1 : Entity_Id;
       E2 : Entity_Id) return Boolean;
-   --  True if package E1 is an ancestor of E2 other than E2 itself
+   --  True if package E1 is an ancestor of E2
 
    function Is_Atomic_Object (N : Node_Id) return Boolean;
    --  Determine whether arbitrary node N denotes a reference to an atomic

Reply via email to