From: Yannick Moy <m...@adacore.com>

In the case the type of an aggregate cannot be determined due to
an ambiguity, caused by the existence of container aggregates,
a hint can be given by GNAT. The test for giving this hint should
be the Ada language version, not the fact that extensions are allowed.
Now fixed.

There is no impact on code generation.

gcc/ada/

        * sem_util.adb (Check_Ambiguous_Aggregate): Fix test.

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

---
 gcc/ada/sem_util.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e8120c2adda..3d12f552f41 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2387,7 +2387,7 @@ package body Sem_Util is
       Actual : Node_Id;
 
    begin
-      if All_Extensions_Allowed then
+      if Ada_Version >= Ada_2022 then
          Actual := First_Actual (Call);
          while Present (Actual) loop
             if Nkind (Actual) = N_Aggregate then
-- 
2.45.1

Reply via email to