https://gcc.gnu.org/g:2671814409b19e9ce90c03e6837e21ae5cf085f1

commit r16-4994-g2671814409b19e9ce90c03e6837e21ae5cf085f1
Author: Eric Botcazou <[email protected]>
Date:   Mon Oct 20 22:33:34 2025 +0200

    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:
---
 gcc/ada/sem_ch12.adb | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 7b3828225bcc..702939a821b4 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);

Reply via email to