[Ada] Fix convention for iteration with multiple loop variables
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 25 May 2018 09:04:09 +0000 (09:04 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:04:09 +0000 (09:04 +0000)
Refactoring based on suggestions from GNAT frontend developers.  Semantics
unaffected.

2018-05-25  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_util.adb (Iterate_Call_Parameters): Fix code convention and
assertions.

From-SVN: r260728

gcc/ada/ChangeLog
gcc/ada/sem_util.adb

index a24c898..5596c59 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-25  Piotr Trojanek  <trojanek@adacore.com>
+
+       * sem_util.adb (Iterate_Call_Parameters): Fix code convention and
+       assertions.
+
 2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb,
index 81a056e..00b7cfb 100644 (file)
@@ -17882,13 +17882,14 @@ package body Sem_Util is
       Formal : Entity_Id := First_Formal (Get_Called_Entity (Call));
 
    begin
-      while Present (Formal) loop
-         pragma Assert (Present (Formal));
+      while Present (Formal) and then Present (Actual) loop
          Handle_Parameter (Formal, Actual);
+
          Next_Formal (Formal);
          Next_Actual (Actual);
       end loop;
 
+      pragma Assert (No (Formal));
       pragma Assert (No (Actual));
    end Iterate_Call_Parameters;