[Ada] Fix PR ada/118731

Message ID 4956774.OV4Wx5bFTl@fomalhaut
State New
Headers
Series [Ada] Fix PR ada/118731 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Eric Botcazou Feb. 4, 2025, 6:50 p.m. UTC
  It's just a missing test for the presence of a nonempty parameter.

Tested on x86-64/Linux, applied on the mainline.


2025-02-04  Eric Botcazou  <ebotcazou@adacore.com>

	PR ada/118731
	* sem_aggr.adb (Resolve_Iterated_Association): Add missing guard.
  

Patch

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index f6db5cb97a4..a7ec772823f 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;