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;