[Ada] Switch Ada_Version_Runtime to Ada 2020
authorArnaud Charlet <charlet@adacore.com>
Thu, 18 Jun 2020 09:34:17 +0000 (05:34 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 27 Jul 2020 08:05:20 +0000 (04:05 -0400)
gcc/ada/

* opt.ads (Ada_Version_Runtime): Set to Ada_2020.
* sem_ch3.adb (Analyze_Subtype_Declaration): Propagate
Is_Independent flag to subtypes.
* libgnarl/s-taprop__linux.adb: Adapt to Ada 2020 warning.
* libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads,
libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb,
libgnat/a-nbnbre.ads, libgnat/a-stobbu.adb,
libgnat/a-stobbu.ads, libgnat/a-stobfi.adb,
libgnat/a-stobfi.ads, libgnat/a-stoubu.adb,
libgnat/a-stoubu.ads, libgnat/a-stoufi.adb,
libgnat/a-stoufi.ads, libgnat/a-stoufo.adb,
libgnat/a-stoufo.ads, libgnat/a-stouut.adb,
libgnat/a-stouut.ads, libgnat/a-strsto.ads,
libgnat/a-ststbo.adb, libgnat/a-ststbo.ads,
libgnat/a-ststun.adb, libgnat/a-ststun.ads,
libgnat/a-stteou.ads, libgnat/s-aoinar.ads,
libgnat/s-aomoar.ads, libgnat/s-atopex.ads,
libgnat/s-putaim.adb, libgnat/s-putaim.ads,
libgnat/s-putima.adb, libgnat/s-putima.ads: Remove pragma
Ada_2020, now redundant.

33 files changed:
gcc/ada/libgnarl/s-taprop__linux.adb
gcc/ada/libgnat/a-nbnbin.adb
gcc/ada/libgnat/a-nbnbin.ads
gcc/ada/libgnat/a-nbnbin__gmp.adb
gcc/ada/libgnat/a-nbnbre.adb
gcc/ada/libgnat/a-nbnbre.ads
gcc/ada/libgnat/a-stobbu.adb
gcc/ada/libgnat/a-stobbu.ads
gcc/ada/libgnat/a-stobfi.adb
gcc/ada/libgnat/a-stobfi.ads
gcc/ada/libgnat/a-stoubu.adb
gcc/ada/libgnat/a-stoubu.ads
gcc/ada/libgnat/a-stoufi.adb
gcc/ada/libgnat/a-stoufi.ads
gcc/ada/libgnat/a-stoufo.adb
gcc/ada/libgnat/a-stoufo.ads
gcc/ada/libgnat/a-stouut.adb
gcc/ada/libgnat/a-stouut.ads
gcc/ada/libgnat/a-strsto.ads
gcc/ada/libgnat/a-ststbo.adb
gcc/ada/libgnat/a-ststbo.ads
gcc/ada/libgnat/a-ststun.adb
gcc/ada/libgnat/a-ststun.ads
gcc/ada/libgnat/a-stteou.ads
gcc/ada/libgnat/s-aoinar.ads
gcc/ada/libgnat/s-aomoar.ads
gcc/ada/libgnat/s-atopex.ads
gcc/ada/libgnat/s-putaim.adb
gcc/ada/libgnat/s-putaim.ads
gcc/ada/libgnat/s-putima.adb
gcc/ada/libgnat/s-putima.ads
gcc/ada/opt.ads
gcc/ada/sem_ch3.adb

index 03f5a7b..fb11e02 100644 (file)
@@ -243,9 +243,9 @@ package body System.Task_Primitives.Operations is
       return Ceiling_Support;
    end Get_Ceiling_Support;
 
-   pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+   pragma Warnings (Off, "non-preelaborable call not allowed*");
    Ceiling_Support : constant Boolean := Get_Ceiling_Support;
-   pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+   pragma Warnings (On, "non-preelaborable call not allowed*");
    --  True if the locking policy is Ceiling_Locking, and the current process
    --  has permission to use this policy. The process has permission if it is
    --  running as 'root', or if the capability was set by the setcap command,
index d3c5f6a..b919d86 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Unchecked_Deallocation;
 with Ada.Strings.Text_Output.Utils;
 
index 5cf7960..7b4974a 100644 (file)
@@ -13,8 +13,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.Text_Output; use Ada.Strings.Text_Output;
 
 private with Ada.Finalization;
index 9481eed..2e8a260 100644 (file)
@@ -31,8 +31,6 @@
 
 --  This is the GMP version of this package
 
-pragma Ada_2020;
-
 with Ada.Unchecked_Conversion;
 with Ada.Unchecked_Deallocation;
 with Interfaces.C;               use Interfaces.C;
index 987cdb4..d61668d 100644 (file)
@@ -31,8 +31,6 @@
 
 --  This is the default version of this package, based on Big_Integers only.
 
-pragma Ada_2020;
-
 with Ada.Strings.Text_Output.Utils;
 
 package body Ada.Numerics.Big_Numbers.Big_Reals is
index 2d4ff63..5a8ebb9 100644 (file)
@@ -13,8 +13,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Numerics.Big_Numbers.Big_Integers;
 
 with Ada.Strings.Text_Output; use Ada.Strings.Text_Output;
index 64f2b6d..fba591d 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 package body Ada.Strings.Text_Output.Bit_Buckets is
 
    type Bit_Bucket_Type is new Sink with null record;
index d2b1011..027e711 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 package Ada.Strings.Text_Output.Bit_Buckets is
    function Bit_Bucket return Sink_Access;
 end Ada.Strings.Text_Output.Bit_Buckets;
index 91edf3f..dd485ba 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.Text_Output.Utils; use Ada.Strings.Text_Output.Utils;
 package body Ada.Strings.Text_Output.Basic_Files is
    use type OS.File_Descriptor;
index a2892f0..65e8e24 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 private with GNAT.OS_Lib;
 package Ada.Strings.Text_Output.Basic_Files is
    --  Normally, you should use Ada.Strings.Text_Output.Files, which
index f563ea5..9fb6c5a 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Unchecked_Deallocation;
 with Ada.Strings.UTF_Encoding.Strings;
 with Ada.Strings.UTF_Encoding.Wide_Strings;
index 519e473..faec897 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 package Ada.Strings.Text_Output.Buffers is
 
    type Buffer (<>) is new Sink with private;
index 90c03da..34086bb 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.Text_Output.Utils; use Ada.Strings.Text_Output.Utils;
 package body Ada.Strings.Text_Output.Files is
    use type OS.File_Descriptor;
index a94124b..0bff45a 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 private with GNAT.OS_Lib;
 private with Ada.Finalization;
 package Ada.Strings.Text_Output.Files is
index 58d7f5a..f80b30a 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.Text_Output.Files;
 with Ada.Strings.Text_Output.Buffers; use Ada.Strings.Text_Output.Buffers;
 with Ada.Strings.Text_Output.Utils; use Ada.Strings.Text_Output.Utils;
index a31ed2d..3b44bd8 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 package Ada.Strings.Text_Output.Formatting is
 
    --  Template-based output, based loosely on C's printf family. Unlike
index 89d6c6e..b5a8f97 100644 (file)
@@ -29,9 +29,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
+
 package body Ada.Strings.Text_Output.Utils is
 
    procedure Put_Octet (S : in out Sink'Class; Item : Character) with Inline;
index d781a06..28d7eca 100644 (file)
@@ -29,8 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 package Ada.Strings.Text_Output.Utils with Preelaborate is
 
    --  This package provides utility functions on Sink'Class. These are
index 1e2814b..ae38b2d 100644 (file)
@@ -30,7 +30,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 package Ada.Streams.Storage with Pure is
 
    type Storage_Stream_Type is abstract new Root_Stream_Type with private;
index 4bd3c17..16c6d00 100644 (file)
@@ -26,7 +26,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 package body Ada.Streams.Storage.Bounded is
 
    ----------
index 1ce6d90..fe41c2c 100644 (file)
@@ -30,7 +30,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 package Ada.Streams.Storage.Bounded with Pure is
 
    type Stream_Type (Max_Elements : Stream_Element_Count) is
index f2f433b..cf3a250 100644 (file)
@@ -26,8 +26,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 with Ada.Unchecked_Deallocation;
+
 package body Ada.Streams.Storage.Unbounded is
 
    procedure Free is new Ada.Unchecked_Deallocation
index 2f01fa0..95aca9b 100644 (file)
@@ -30,8 +30,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 private with Ada.Finalization;
+
 package Ada.Streams.Storage.Unbounded with Preelaborate is
 
    type Stream_Type is new Storage_Stream_Type with private with
index f4b8966..924b550 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 with Ada.Strings.UTF_Encoding;
 with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
+
 package Ada.Strings.Text_Output with Preelaborate is
 
    --  This package provides a "Sink" abstraction, to which characters of type
index 17e5cdf..558754f 100644 (file)
@@ -33,8 +33,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 generic
    type Atomic_Type is range <> with Atomic;
 package System.Atomic_Operations.Integer_Arithmetic
index f6057ad..4062d1a 100644 (file)
@@ -33,8 +33,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 generic
    type Atomic_Type is mod <> with Atomic;
 package System.Atomic_Operations.Modular_Arithmetic
index 11d850e..996883c 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
-
 generic
    type Atomic_Type is private with Atomic;
 package System.Atomic_Operations.Exchange
   with Pure
---  Blocking
 is
    function Atomic_Exchange
      (Item  : aliased in out Atomic_Type;
index ed8cfe4..08fa7b7 100644 (file)
@@ -29,7 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 with Unchecked_Conversion;
 with Ada.Strings.Text_Output.Utils;
 use Ada.Strings.Text_Output;
index c06b751..b4dd8c2 100644 (file)
@@ -29,9 +29,9 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 with Ada.Strings.Text_Output;
 with Ada.Task_Identification;
+
 package System.Put_Task_Images is
 
    --  This package contains subprograms that are called by the generated code
index 20991c3..4ae612d 100644 (file)
@@ -29,7 +29,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 with Unchecked_Conversion;
 with Ada.Strings.Text_Output.Utils;
 use Ada.Strings.Text_Output;
index d4e4410..17e184a 100644 (file)
@@ -29,9 +29,9 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-pragma Ada_2020;
 with Ada.Strings.Text_Output;
 with System.Unsigned_Types;
+
 package System.Put_Images is
 
    --  This package contains subprograms that are called by the generated code
index 78b2b50..c982f83 100644 (file)
@@ -114,7 +114,7 @@ package Opt is
    --  remains set to Ada_Version_Default). This is used in the rare cases
    --  (notably pragma Obsolescent) where we want the explicit version set.
 
-   Ada_Version_Runtime : Ada_Version_Type := Ada_2012;
+   Ada_Version_Runtime : Ada_Version_Type := Ada_2020;
    --  GNAT
    --  Ada version used to compile the runtime. Used to set Ada_Version (but
    --  not Ada_Version_Explicit) when compiling predefined or internal units.
index 96f05a5..a5690d6 100644 (file)
@@ -5718,11 +5718,13 @@ package body Sem_Ch3 is
 
       --  If the base type is a scalar type, or else if there is no
       --  constraint, the atomic flag is inherited by the subtype.
+      --  Ditto for the Independent aspect.
 
       if Is_Scalar_Type (Id)
         or else Is_Entity_Name (Subtype_Indication (N))
       then
          Set_Is_Atomic (Id, Is_Atomic (T));
+         Set_Is_Independent (Id, Is_Independent (T));
       end if;
 
       --  Remaining processing depends on characteristics of base type