]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix documentation of Is_Ancestor_Package
authorRonan Desplanques <desplanques@adacore.com>
Tue, 26 Aug 2025 13:39:03 +0000 (15:39 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:24 +0000 (14:59 +0200)
"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.

gcc/ada/sem_util.adb
gcc/ada/sem_util.ads

index 8a3998d7d123a0e99492d9dce1e1155ca13a993b..432b036396d71ec6102de7778d0902a92309d486 100644 (file)
@@ -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;
index 04caed57506548b477a652ba7a2ecb08459357b9..88a1841cb38920851856308f13b491249d98790b 100644 (file)
@@ -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