From ec28faefe1fed756e3a4daee73533984d569b570 Mon Sep 17 00:00:00 2001 From: Bob Duff Date: Tue, 7 Jul 2020 14:36:50 -0400 Subject: [PATCH] [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. --- gcc/ada/libgnat/a-cidlli.adb | 13 ++++++++----- gcc/ada/libgnat/a-coinve.adb | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) 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; -- 2.30.2