]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Static intrinsic functions are a core language extension.
authorSteve Baird <baird@adacore.com>
Sat, 8 Oct 2022 00:20:31 +0000 (17:20 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 4 Nov 2022 13:47:30 +0000 (14:47 +0100)
GNAT-defined Ada extensions are divided into two categories: those that are
enabled by either -gnatX or -gnatX0 and those which require -gnatX0.
Move static intrinsic functions from the second category into the first.

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst: Add the standard
'... "On" enables this extension.' sentence to the description of
static intrinsic functions.
* sem_ch13.adb
(Analyze_Aspect_Spec): In the call to Error_Msg_GNAT_Extension for
a Static aspect specification for an intrinsic function, specify
Is_Core_Extension => True.
* sem_eval.adb
(Eval_Intrinsic_Call): Test Core_Extensions_Allowed instead of
testing All_Extensions_Allowed.
* gnat_rm.texi: Regenerate.

gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/gnat_rm.texi
gcc/ada/sem_ch13.adb
gcc/ada/sem_eval.adb

index 100d79e69b1fe5de15cbb4060d77150579fb33ef..7e5fb70069113fa31c67bb2503bc4e9047ed61f0 100644 (file)
@@ -2200,6 +2200,8 @@ are identified below.
   functions and the compiler will evaluate some of these intrinsic statically,
   in particular the ``Shift_Left`` and ``Shift_Right`` intrinsics.
 
+  An Extensions_Allowed pragma argument of "On" enables this extension.
+
 * ``[]`` aggregates
 
   This new aggregate syntax for arrays and containers is provided under -gnatX
index 6fcaca765718e4cce3d93626de5df9fbf4202051..fbd8bb8d6b291b1bad3d8467a522b2e3177408e3 100644 (file)
@@ -3639,6 +3639,8 @@ The Ada 202x @code{Static} aspect can be specified on Intrinsic imported
 functions and the compiler will evaluate some of these intrinsic statically,
 in particular the @code{Shift_Left} and @code{Shift_Right} intrinsics.
 
+An Extensions_Allowed pragma argument of “On” enables this extension.
+
 @item 
 @code{[]} aggregates
 
index 6f4d33b6d55322d50241e9bab0d83c3961ee1fad..2eb1a69e764af78f3bac37731e7fce67d17146bf 100644 (file)
@@ -2408,7 +2408,8 @@ package body Sem_Ch13 is
 
                   elsif Is_Imported_Intrinsic then
                      Error_Msg_GNAT_Extension
-                       ("aspect % on intrinsic function", Sloc (Aspect));
+                       ("aspect % on intrinsic function", Sloc (Aspect),
+                        Is_Core_Extension => True);
 
                   else
                      Error_Msg_N
index 6339cfe3b04957de46a4fea6ba7fcc1782ac0c3e..195f27e14d676efbe165136d1989617da7ab4f9a 100644 (file)
@@ -2856,10 +2856,11 @@ package body Sem_Eval is
          return;
       end if;
 
-      --  Intrinsic calls as part of a static function is a language extension.
+      --  Intrinsic calls as part of a static function is a (core)
+      --  language extension.
 
       if Checking_Potentially_Static_Expression
-        and then not All_Extensions_Allowed
+        and then not Core_Extensions_Allowed
       then
          return;
       end if;