From: Bob Duff Date: Tue, 7 Jul 2020 18:36:50 +0000 (-0400) Subject: [Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec28faefe1fed756e3a4daee73533984d569b570;p=gcc.git [Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def types gcc/ada/ * libgnat/a-coinve.adb, libgnat/a-cidlli.adb (Put_Image): Call Iterate. --- diff --git a/gcc/ada/libgnat/a-cidlli.adb b/gcc/ada/libgnat/a-cidlli.adb index ea962c32cf6..29286063d39 100644 --- a/gcc/ada/libgnat/a-cidlli.adb +++ b/gcc/ada/libgnat/a-cidlli.adb @@ -1307,19 +1307,22 @@ is is First_Time : Boolean := True; use System.Put_Images; - begin - Array_Before (S); - for X of V loop + procedure Put_Elem (Position : Cursor); + procedure Put_Elem (Position : Cursor) is + begin if First_Time then First_Time := False; else Simple_Array_Between (S); end if; - Element_Type'Put_Image (S, X); - end loop; + Element_Type'Put_Image (S, Element (Position)); + end Put_Elem; + begin + Array_Before (S); + Iterate (V, Put_Elem'Access); Array_After (S); end Put_Image; diff --git a/gcc/ada/libgnat/a-coinve.adb b/gcc/ada/libgnat/a-coinve.adb index 5999a2c2d30..48e81f15cb0 100644 --- a/gcc/ada/libgnat/a-coinve.adb +++ b/gcc/ada/libgnat/a-coinve.adb @@ -2659,19 +2659,22 @@ is is First_Time : Boolean := True; use System.Put_Images; - begin - Array_Before (S); - for X of V loop + procedure Put_Elem (Position : Cursor); + procedure Put_Elem (Position : Cursor) is + begin if First_Time then First_Time := False; else Simple_Array_Between (S); end if; - Element_Type'Put_Image (S, X); - end loop; + Element_Type'Put_Image (S, Element (Position)); + end Put_Elem; + begin + Array_Before (S); + Iterate (V, Put_Elem'Access); Array_After (S); end Put_Image;