https://gcc.gnu.org/g:64c66f5bce60fcc4a943bcac1865db2a72aaa1bd

commit r15-7359-g64c66f5bce60fcc4a943bcac1865db2a72aaa1bd
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Tue Feb 4 19:48:09 2025 +0100

    Ada: Fix assertion failure with iterator in container aggregate
    
    It's just a missing test for the presence of a nonempty parameter.
    
    gcc/ada/
            PR ada/118731
            * sem_aggr.adb (Resolve_Iterated_Association): Add missing guard.

Diff:
---
 gcc/ada/sem_aggr.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index f6db5cb97a4a..a7ec772823f6 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3933,6 +3933,7 @@ package body Sem_Aggr is
 
             if Is_Entity_Name (Choice)
               and then Is_Type (Entity (Choice))
+              and then Present (Key_Type)
               and then Base_Type (Entity (Choice)) = Base_Type (Key_Type)
             then
                null;

Reply via email to