"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.
(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;
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