]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ada: Fix assertion failure with iterator in container aggregate
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 4 Feb 2025 18:48:09 +0000 (19:48 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 4 Feb 2025 18:49:49 +0000 (19:49 +0100)
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.

gcc/ada/sem_aggr.adb

index f6db5cb97a4a39a3f31841fb2ff02ba60d12a2f4..a7ec772823f6bf89670dd4a8c1a3283546625bd1 100644 (file)
@@ -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;