After a period of experimentation, allow 'Reduce in Ada 2022 mode.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_attr.adb (Analyze_Attribute [Attribute_Reduce]): Allow
        'Reduce for Ada 2022 and above.
        * sem_attr.ads (Attribute_Impl_Def): 'Reduce is no longer
        implementation defined.
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -5775,11 +5775,7 @@ package body Sem_Attr is
 
       when Attribute_Reduce =>
          Check_E2;
-
-         if not Extensions_Allowed then
-            Error_Attr
-              ("% attribute only supported under -gnatX", P);
-         end if;
+         Error_Msg_Ada_2022_Feature ("Reduce attribute", Sloc (N));
 
          declare
             Stream : constant Node_Id := Prefix (N);


diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads
--- a/gcc/ada/sem_attr.ads
+++ b/gcc/ada/sem_attr.ads
@@ -407,13 +407,6 @@ package Sem_Attr is
       --  as Range applied to the array itself. The result is of type universal
       --  integer.
 
-      ------------
-      -- Reduce --
-      ------------
-
-      Attribute_Reduce => True,
-      --  See AI12-0262-1
-
       ---------
       -- Ref --
       ---------


Reply via email to