From: Eric Botcazou Date: Fri, 16 Aug 2024 23:18:43 +0000 (+0200) Subject: ada: Fix assertion failure on private limited with clause X-Git-Tag: basepoints/gcc-16~6248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdd5dd2125ca850aa8599f76bed02509590541ef;p=thirdparty%2Fgcc.git 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. --- 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;