diff mbox series

[Ada] Allow 'Reduce with -gnat2022

Message ID 20220517082740.GA1089269@adacore.com
State New
Headers show
Series [Ada] Allow 'Reduce with -gnat2022 | expand

Commit Message

Pierre-Marie de Rodat May 17, 2022, 8:27 a.m. UTC
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 mbox series

Patch

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 --
       ---------