https://gcc.gnu.org/g:cdd5dd2125ca850aa8599f76bed02509590541ef

commit r15-3305-gcdd5dd2125ca850aa8599f76bed02509590541ef
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Sat Aug 17 01:18:43 2024 +0200

    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:
---
 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 990600614719..13c44c5e302c 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;

Reply via email to