From: Eric Botcazou <[email protected]>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 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 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);
-- 
2.51.0

Reply via email to