]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix test for giving hint on ambiguous aggregate
authorYannick Moy <moy@adacore.com>
Fri, 3 May 2024 13:02:39 +0000 (15:02 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 13 Jun 2024 13:30:34 +0000 (15:30 +0200)
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.

gcc/ada/sem_util.adb

index e8120c2addacce475163fa997302cf6a65187d08..3d12f552f41bf3f935b80fd980e40600816353ec 100644 (file)
@@ -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