ada: Fix assertion failure on private limited with clause

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.
This commit is contained in:
Eric Botcazou 2024-08-17 01:18:43 +02:00 committed by Marc Poulhiès
parent d506247921
commit cdd5dd2125

View file

@ -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;