From: Eric Botcazou Date: Mon, 20 Oct 2025 20:33:34 +0000 (+0200) Subject: ada: Fix box accepted as second association of a generic formal package X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2671814409b19e9ce90c03e6837e21ae5cf085f1;p=thirdparty%2Fgcc.git ada: Fix box accepted as second association of a generic formal package The syntax is plain invalid because a box can be accepted as a positional parameter only in the first place. gcc/ada/ChangeLog: PR ada/61127 * sem_ch12.adb (Associations.Match_Positional): Remove the always false condition that guards the error on a positional box. --- diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 7b3828225bc..702939a821b 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -1662,18 +1662,14 @@ package body Sem_Ch12 is if Box_Present (Src_Assoc) then Assoc.Actual := (Kind => Box_Actual); - if False then -- ??? - -- Disable this for now, because we have various - -- code that needs to be updated. - Error_Msg_N - ("box requires named notation", Src_Assoc); - end if; + Error_Msg_N ("box requires named notation", Src_Assoc); else Assoc.Actual := (Name_Exp, Explicit_Generic_Actual_Parameter (Src_Assoc)); pragma Assert (Present (Assoc.Actual.Name_Exp)); end if; + Assoc.Actual_Origin := From_Explicit_Actual; Next (Src_Assoc);