From: Eric Botcazou Date: Tue, 10 Mar 2026 09:14:20 +0000 (+0100) Subject: ada: Fix iterator for Iterable aspect rejected without subtype indication X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73659413d445b16accc64c28df404945f2ac157f;p=thirdparty%2Fgcc.git ada: Fix iterator for Iterable aspect rejected without subtype indication Iterator specifications of the In form without subtype indication are parsed as a choice list, and later turned during semantic analysis into a bona-fide N_Iterator_Specification node when there is a single choice with an iterator type, but the case of the GNAT Iterable aspect is overlooked in the process. gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Array_Aggregate): Also rewrite a choice list with a single choice as an iterator specification when the choice's type has the GNAT Iterable aspect specified. --- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 825aeb3a877..5f6570f36f0 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2581,7 +2581,10 @@ package body Sem_Aggr is Analyze (Choice); if Is_Object_Reference (Choice) - and then Is_Iterator (Etype (Choice)) + and then (Is_Iterator (Etype (Choice)) + or else + Has_Aspect + (Etype (Choice), Aspect_Iterable)) then Set_Iterator_Specification (Assoc,