From: Eric Botcazou <[email protected]>
This checks that the name is of an entity before accessing its Entity field.
gcc/ada/
* sem_ch8.adb (Has_Private_With): Add test on Is_Entity_Name.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch8.adb | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 99060061471..13c44c5e302 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -8980,6 +8980,7 @@ package body Sem_Ch8 is
while Present (Item) loop
if Nkind (Item) = N_With_Clause
and then Private_Present (Item)
+ and then Is_Entity_Name (Name (Item))
and then Entity (Name (Item)) = E
then
return True;
--
2.45.2