diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-09-23 19:06:54 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-29 11:08:46 +0200 |
commit | 01ea0437ead0dda3acd51cfb80a01de5feb56929 (patch) | |
tree | fed64b56dcb28db8a2e6735a7a6660fb3c0d2e3f | |
parent | a1cd4d52d6ef90b977fb2d80c1cf17f3efa5b01d (diff) | |
download | gcc-01ea0437ead0dda3acd51cfb80a01de5feb56929.zip gcc-01ea0437ead0dda3acd51cfb80a01de5feb56929.tar.gz gcc-01ea0437ead0dda3acd51cfb80a01de5feb56929.tar.bz2 |
ada: Fix checking of Refined_State with nested package renamings
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.
-rw-r--r-- | gcc/ada/sem_util.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 9ae082c..25e886e 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6018,8 +6018,11 @@ package body Sem_Util is 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; |