From cb030dd7350381e47bdb168517507426ad23a297 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 18 Jun 2020 05:34:17 -0400 Subject: [PATCH] [Ada] Switch Ada_Version_Runtime to Ada 2020 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. --- gcc/ada/libgnarl/s-taprop__linux.adb | 4 ++-- gcc/ada/libgnat/a-nbnbin.adb | 2 -- gcc/ada/libgnat/a-nbnbin.ads | 2 -- gcc/ada/libgnat/a-nbnbin__gmp.adb | 2 -- gcc/ada/libgnat/a-nbnbre.adb | 2 -- gcc/ada/libgnat/a-nbnbre.ads | 2 -- gcc/ada/libgnat/a-stobbu.adb | 2 -- gcc/ada/libgnat/a-stobbu.ads | 2 -- gcc/ada/libgnat/a-stobfi.adb | 2 -- gcc/ada/libgnat/a-stobfi.ads | 2 -- gcc/ada/libgnat/a-stoubu.adb | 2 -- gcc/ada/libgnat/a-stoubu.ads | 2 -- gcc/ada/libgnat/a-stoufi.adb | 2 -- gcc/ada/libgnat/a-stoufi.ads | 2 -- gcc/ada/libgnat/a-stoufo.adb | 2 -- gcc/ada/libgnat/a-stoufo.ads | 2 -- gcc/ada/libgnat/a-stouut.adb | 3 +-- gcc/ada/libgnat/a-stouut.ads | 2 -- gcc/ada/libgnat/a-strsto.ads | 1 - gcc/ada/libgnat/a-ststbo.adb | 1 - gcc/ada/libgnat/a-ststbo.ads | 1 - gcc/ada/libgnat/a-ststun.adb | 2 +- gcc/ada/libgnat/a-ststun.ads | 2 +- gcc/ada/libgnat/a-stteou.ads | 3 +-- gcc/ada/libgnat/s-aoinar.ads | 2 -- gcc/ada/libgnat/s-aomoar.ads | 2 -- gcc/ada/libgnat/s-atopex.ads | 3 --- gcc/ada/libgnat/s-putaim.adb | 1 - gcc/ada/libgnat/s-putaim.ads | 2 +- gcc/ada/libgnat/s-putima.adb | 1 - gcc/ada/libgnat/s-putima.ads | 2 +- gcc/ada/opt.ads | 2 +- gcc/ada/sem_ch3.adb | 2 ++ 33 files changed, 11 insertions(+), 55 deletions(-) diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb index 03f5a7ba4cf..fb11e0204a4 100644 --- a/gcc/ada/libgnarl/s-taprop__linux.adb +++ b/gcc/ada/libgnarl/s-taprop__linux.adb @@ -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, diff --git a/gcc/ada/libgnat/a-nbnbin.adb b/gcc/ada/libgnat/a-nbnbin.adb index d3c5f6a37ff..b919d86490e 100644 --- a/gcc/ada/libgnat/a-nbnbin.adb +++ b/gcc/ada/libgnat/a-nbnbin.adb @@ -29,8 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - with Ada.Unchecked_Deallocation; with Ada.Strings.Text_Output.Utils; diff --git a/gcc/ada/libgnat/a-nbnbin.ads b/gcc/ada/libgnat/a-nbnbin.ads index 5cf7960db10..7b4974a934f 100644 --- a/gcc/ada/libgnat/a-nbnbin.ads +++ b/gcc/ada/libgnat/a-nbnbin.ads @@ -13,8 +13,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - with Ada.Strings.Text_Output; use Ada.Strings.Text_Output; private with Ada.Finalization; diff --git a/gcc/ada/libgnat/a-nbnbin__gmp.adb b/gcc/ada/libgnat/a-nbnbin__gmp.adb index 9481eed63a1..2e8a2604d64 100644 --- a/gcc/ada/libgnat/a-nbnbin__gmp.adb +++ b/gcc/ada/libgnat/a-nbnbin__gmp.adb @@ -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; diff --git a/gcc/ada/libgnat/a-nbnbre.adb b/gcc/ada/libgnat/a-nbnbre.adb index 987cdb4edae..d61668d1abe 100644 --- a/gcc/ada/libgnat/a-nbnbre.adb +++ b/gcc/ada/libgnat/a-nbnbre.adb @@ -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 diff --git a/gcc/ada/libgnat/a-nbnbre.ads b/gcc/ada/libgnat/a-nbnbre.ads index 2d4ff63f64f..5a8ebb9ccb1 100644 --- a/gcc/ada/libgnat/a-nbnbre.ads +++ b/gcc/ada/libgnat/a-nbnbre.ads @@ -13,8 +13,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - with Ada.Numerics.Big_Numbers.Big_Integers; with Ada.Strings.Text_Output; use Ada.Strings.Text_Output; diff --git a/gcc/ada/libgnat/a-stobbu.adb b/gcc/ada/libgnat/a-stobbu.adb index 64f2b6da76d..fba591d2200 100644 --- a/gcc/ada/libgnat/a-stobbu.adb +++ b/gcc/ada/libgnat/a-stobbu.adb @@ -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; diff --git a/gcc/ada/libgnat/a-stobbu.ads b/gcc/ada/libgnat/a-stobbu.ads index d2b1011f8f2..027e71170d3 100644 --- a/gcc/ada/libgnat/a-stobbu.ads +++ b/gcc/ada/libgnat/a-stobbu.ads @@ -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; diff --git a/gcc/ada/libgnat/a-stobfi.adb b/gcc/ada/libgnat/a-stobfi.adb index 91edf3fd170..dd485ba8c3d 100644 --- a/gcc/ada/libgnat/a-stobfi.adb +++ b/gcc/ada/libgnat/a-stobfi.adb @@ -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; diff --git a/gcc/ada/libgnat/a-stobfi.ads b/gcc/ada/libgnat/a-stobfi.ads index a2892f087aa..65e8e24e62e 100644 --- a/gcc/ada/libgnat/a-stobfi.ads +++ b/gcc/ada/libgnat/a-stobfi.ads @@ -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 diff --git a/gcc/ada/libgnat/a-stoubu.adb b/gcc/ada/libgnat/a-stoubu.adb index f563ea5c0dd..9fb6c5ad3e5 100644 --- a/gcc/ada/libgnat/a-stoubu.adb +++ b/gcc/ada/libgnat/a-stoubu.adb @@ -29,8 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - with Unchecked_Deallocation; with Ada.Strings.UTF_Encoding.Strings; with Ada.Strings.UTF_Encoding.Wide_Strings; diff --git a/gcc/ada/libgnat/a-stoubu.ads b/gcc/ada/libgnat/a-stoubu.ads index 519e473da2f..faec897f917 100644 --- a/gcc/ada/libgnat/a-stoubu.ads +++ b/gcc/ada/libgnat/a-stoubu.ads @@ -29,8 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - package Ada.Strings.Text_Output.Buffers is type Buffer (<>) is new Sink with private; diff --git a/gcc/ada/libgnat/a-stoufi.adb b/gcc/ada/libgnat/a-stoufi.adb index 90c03daf2a0..34086bbed2b 100644 --- a/gcc/ada/libgnat/a-stoufi.adb +++ b/gcc/ada/libgnat/a-stoufi.adb @@ -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; diff --git a/gcc/ada/libgnat/a-stoufi.ads b/gcc/ada/libgnat/a-stoufi.ads index a94124b421f..0bff45afed9 100644 --- a/gcc/ada/libgnat/a-stoufi.ads +++ b/gcc/ada/libgnat/a-stoufi.ads @@ -29,8 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - private with GNAT.OS_Lib; private with Ada.Finalization; package Ada.Strings.Text_Output.Files is diff --git a/gcc/ada/libgnat/a-stoufo.adb b/gcc/ada/libgnat/a-stoufo.adb index 58d7f5a4be1..f80b30a7d22 100644 --- a/gcc/ada/libgnat/a-stoufo.adb +++ b/gcc/ada/libgnat/a-stoufo.adb @@ -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; diff --git a/gcc/ada/libgnat/a-stoufo.ads b/gcc/ada/libgnat/a-stoufo.ads index a31ed2d4c12..3b44bd89be9 100644 --- a/gcc/ada/libgnat/a-stoufo.ads +++ b/gcc/ada/libgnat/a-stoufo.ads @@ -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 diff --git a/gcc/ada/libgnat/a-stouut.adb b/gcc/ada/libgnat/a-stouut.adb index 89d6c6e298f..b5a8f971570 100644 --- a/gcc/ada/libgnat/a-stouut.adb +++ b/gcc/ada/libgnat/a-stouut.adb @@ -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; diff --git a/gcc/ada/libgnat/a-stouut.ads b/gcc/ada/libgnat/a-stouut.ads index d781a0617aa..28d7eca77c6 100644 --- a/gcc/ada/libgnat/a-stouut.ads +++ b/gcc/ada/libgnat/a-stouut.ads @@ -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 diff --git a/gcc/ada/libgnat/a-strsto.ads b/gcc/ada/libgnat/a-strsto.ads index 1e2814b6baf..ae38b2d8708 100644 --- a/gcc/ada/libgnat/a-strsto.ads +++ b/gcc/ada/libgnat/a-strsto.ads @@ -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; diff --git a/gcc/ada/libgnat/a-ststbo.adb b/gcc/ada/libgnat/a-ststbo.adb index 4bd3c174254..16c6d009b38 100644 --- a/gcc/ada/libgnat/a-ststbo.adb +++ b/gcc/ada/libgnat/a-ststbo.adb @@ -26,7 +26,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; package body Ada.Streams.Storage.Bounded is ---------- diff --git a/gcc/ada/libgnat/a-ststbo.ads b/gcc/ada/libgnat/a-ststbo.ads index 1ce6d90f808..fe41c2cea0e 100644 --- a/gcc/ada/libgnat/a-ststbo.ads +++ b/gcc/ada/libgnat/a-ststbo.ads @@ -30,7 +30,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; package Ada.Streams.Storage.Bounded with Pure is type Stream_Type (Max_Elements : Stream_Element_Count) is diff --git a/gcc/ada/libgnat/a-ststun.adb b/gcc/ada/libgnat/a-ststun.adb index f2f433be61c..cf3a250aab9 100644 --- a/gcc/ada/libgnat/a-ststun.adb +++ b/gcc/ada/libgnat/a-ststun.adb @@ -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 diff --git a/gcc/ada/libgnat/a-ststun.ads b/gcc/ada/libgnat/a-ststun.ads index 2f01fa097cf..95aca9b9269 100644 --- a/gcc/ada/libgnat/a-ststun.ads +++ b/gcc/ada/libgnat/a-ststun.ads @@ -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 diff --git a/gcc/ada/libgnat/a-stteou.ads b/gcc/ada/libgnat/a-stteou.ads index f4b8966c1fb..924b55003c6 100644 --- a/gcc/ada/libgnat/a-stteou.ads +++ b/gcc/ada/libgnat/a-stteou.ads @@ -29,10 +29,9 @@ -- -- ------------------------------------------------------------------------------ -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 diff --git a/gcc/ada/libgnat/s-aoinar.ads b/gcc/ada/libgnat/s-aoinar.ads index 17e5cdf224d..558754fd71a 100644 --- a/gcc/ada/libgnat/s-aoinar.ads +++ b/gcc/ada/libgnat/s-aoinar.ads @@ -33,8 +33,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - generic type Atomic_Type is range <> with Atomic; package System.Atomic_Operations.Integer_Arithmetic diff --git a/gcc/ada/libgnat/s-aomoar.ads b/gcc/ada/libgnat/s-aomoar.ads index f6057ada439..4062d1a4e42 100644 --- a/gcc/ada/libgnat/s-aomoar.ads +++ b/gcc/ada/libgnat/s-aomoar.ads @@ -33,8 +33,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; - generic type Atomic_Type is mod <> with Atomic; package System.Atomic_Operations.Modular_Arithmetic diff --git a/gcc/ada/libgnat/s-atopex.ads b/gcc/ada/libgnat/s-atopex.ads index 11d850ef47e..996883c973e 100644 --- a/gcc/ada/libgnat/s-atopex.ads +++ b/gcc/ada/libgnat/s-atopex.ads @@ -33,13 +33,10 @@ -- -- ------------------------------------------------------------------------------ -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; diff --git a/gcc/ada/libgnat/s-putaim.adb b/gcc/ada/libgnat/s-putaim.adb index ed8cfe4b1f9..08fa7b7609d 100644 --- a/gcc/ada/libgnat/s-putaim.adb +++ b/gcc/ada/libgnat/s-putaim.adb @@ -29,7 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; with Unchecked_Conversion; with Ada.Strings.Text_Output.Utils; use Ada.Strings.Text_Output; diff --git a/gcc/ada/libgnat/s-putaim.ads b/gcc/ada/libgnat/s-putaim.ads index c06b75118a1..b4dd8c27e56 100644 --- a/gcc/ada/libgnat/s-putaim.ads +++ b/gcc/ada/libgnat/s-putaim.ads @@ -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 diff --git a/gcc/ada/libgnat/s-putima.adb b/gcc/ada/libgnat/s-putima.adb index 20991c390e5..4ae612d0062 100644 --- a/gcc/ada/libgnat/s-putima.adb +++ b/gcc/ada/libgnat/s-putima.adb @@ -29,7 +29,6 @@ -- -- ------------------------------------------------------------------------------ -pragma Ada_2020; with Unchecked_Conversion; with Ada.Strings.Text_Output.Utils; use Ada.Strings.Text_Output; diff --git a/gcc/ada/libgnat/s-putima.ads b/gcc/ada/libgnat/s-putima.ads index d4e4410b35a..17e184a5539 100644 --- a/gcc/ada/libgnat/s-putima.ads +++ b/gcc/ada/libgnat/s-putima.ads @@ -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 diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 78b2b50e033..c982f83b9e4 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -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. diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 96f05a5eb28..a5690d62e56 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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 -- 2.30.2