[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 a24c898722cd391061c1de86c592af70c98debef..5596c595028eec6d43808aea2b1e91ba3cd9586a 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 81a056ecff63e5e16cdacba60b6b5aebccfb3c9f..00b7cfba891342d6e1284170e1c59c21f01c51f2 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;