When collecting package state declared in package body, we should only
recursively examine the visible part of nested packages while ignoring other
entities related to packages (e.g. package bodies or package renamings).
gcc/ada/
* sem_util.adb (Collect_Visible_States): Ignore package renamings.
Append_New_Elmt (Item_Id, States);
-- Recursively gather the visible states of a nested package
+ -- except for nested package renamings.
- elsif Ekind (Item_Id) = E_Package then
+ elsif Ekind (Item_Id) = E_Package
+ and then No (Renamed_Entity (Item_Id))
+ then
Collect_Visible_States (Item_Id, States);
end if;