]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lib.adb, lib.ads: (In_Predefined_Unit): New functions
authorRobert Dewar <dewar@adacore.com>
Tue, 31 Oct 2006 17:49:05 +0000 (18:49 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 31 Oct 2006 17:49:05 +0000 (18:49 +0100)
2006-10-31  Robert Dewar  <dewar@adacore.com>

* lib.adb, lib.ads: (In_Predefined_Unit): New functions

* a-finali.ads, a-ngcoty.ads, a-strbou.ads, a-stream.ads, a-strmap.ads,
a-strunb.ads, a-stwibo.ads, a-stwima.ads, a-stwiun.ads, a-taside.ads,
a-coorse.ads, a-convec.ads, a-coinve.ads, a-cohama.ads, a-ciorse.ads,
a-cihama.ads, a-cihase.ads, a-cohase.ads, a-ciorma.ads, a-coorma.ads,
a-ciormu.ads, a-coormu.ads, a-stzbou.ads, a-stzmap.ads, a-stzunb.ads,
a-except-2005.ads: Add pragma Preelaborable_Warning

From-SVN: r118242

28 files changed:
gcc/ada/a-cihama.ads
gcc/ada/a-cihase.ads
gcc/ada/a-ciorma.ads
gcc/ada/a-ciormu.ads
gcc/ada/a-ciorse.ads
gcc/ada/a-cohama.ads
gcc/ada/a-cohase.ads
gcc/ada/a-coinve.ads
gcc/ada/a-convec.ads
gcc/ada/a-coorma.ads
gcc/ada/a-coormu.ads
gcc/ada/a-coorse.ads
gcc/ada/a-except-2005.ads
gcc/ada/a-finali.ads
gcc/ada/a-ngcoty.ads
gcc/ada/a-strbou.ads
gcc/ada/a-stream.ads
gcc/ada/a-strmap.ads
gcc/ada/a-strunb.ads
gcc/ada/a-stwibo.ads
gcc/ada/a-stwima.ads
gcc/ada/a-stwiun.ads
gcc/ada/a-stzbou.ads
gcc/ada/a-stzmap.ads
gcc/ada/a-stzunb.ads
gcc/ada/a-taside.ads
gcc/ada/lib.adb
gcc/ada/lib.ads

index 18963d5048cb64cd73c5bc1c772667ac477390b1..b1b4630376aa23bfcdc74afc2c5237c15e1f49bb 100644 (file)
@@ -7,7 +7,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,7 +50,10 @@ package Ada.Containers.Indefinite_Hashed_Maps is
    pragma Preelaborate;
 
    type Map is tagged private;
+   pragma Preelaborable_Initialization (Map);
+
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Map  : constant Map;
    No_Element : constant Cursor;
index 71636340414dfb4e79cd16e5af204a33654265a0..0d36adfe609911b7998791c6e66b2aa71f9f8abe 100644 (file)
@@ -7,7 +7,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -52,8 +52,10 @@ package Ada.Containers.Indefinite_Hashed_Sets is
    pragma Preelaborate;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index 7d16b2b4c1a21ac7ee1233a8277e0cdea1cdac9e..0d733a1756695d565a7705981e01d651acf3a145 100644 (file)
@@ -7,7 +7,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -51,8 +51,10 @@ package Ada.Containers.Indefinite_Ordered_Maps is
    function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
 
    type Map is tagged private;
+   pragma Preelaborable_Initialization (Map);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Map : constant Map;
 
index 358c891649d63b209cfd81a22683633330a4729d..0bcf19c440bb417a8e80611c8dab10077a2ef36c 100644 (file)
@@ -50,8 +50,10 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
    function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index 1c1c7860332c3638a56102f4ea37b0003149dd21..3fc5f45275281e110691701520afd5a35ee23c45 100644 (file)
@@ -7,7 +7,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,8 +50,10 @@ package Ada.Containers.Indefinite_Ordered_Sets is
    function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index d65401f01ebf129a60c2ff725a074f54e4069dff..f090c82f99e4442502f582393c5d9707cdf3ab69 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -49,8 +49,10 @@ package Ada.Containers.Hashed_Maps is
    pragma Preelaborate;
 
    type Map is tagged private;
+   pragma Preelaborable_Initialization (Map);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Map : constant Map;
 
index dccb56cb0ccecd108251f316fc2f3432787337a2..b0eb14cc2909fa794d7d86db883b635144b61929 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -51,8 +51,10 @@ package Ada.Containers.Hashed_Sets is
    pragma Preelaborate;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index e5587f14625da369a4a876bb86c42983f43e5e7e..317dc75366e2c8c51bd3b4b2f23fd4cec1371206 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -52,8 +52,10 @@ package Ada.Containers.Indefinite_Vectors is
    No_Index : constant Extended_Index := Extended_Index'First;
 
    type Vector is tagged private;
+   pragma Preelaborable_Initialization (Vector);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Vector : constant Vector;
 
index 4fa0281d41c72d7d4e91bd29c1587073a8c25cd4..bceea179995fda90ffc78c7907bcd8dcca2d7bad 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -51,8 +51,10 @@ package Ada.Containers.Vectors is
    No_Index : constant Extended_Index := Extended_Index'First;
 
    type Vector is tagged private;
+   pragma Preelaborable_Initialization (Vector);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Vector : constant Vector;
 
index f07b07373d0aff68d519aee90e8c0fe505f9ae2e..18de34dddc3d64c0667e506d534083ea52f2d565 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,8 +50,10 @@ package Ada.Containers.Ordered_Maps is
    function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
 
    type Map is tagged private;
+   pragma Preelaborable_Initialization (Map);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Map : constant Map;
 
index 7e53d1ca7a7a052ba7b8f30dfdb209e6e4ad63b1..ff32f8c1559ffb428859d1d9aba6bb9a7b1c9088 100644 (file)
@@ -49,8 +49,10 @@ package Ada.Containers.Ordered_Multisets is
    function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index 8afbd01e96fd875deb85389ae2339c6e29ec40d9..2cc8accad53975c2da0809e3a1b19c121cf4881d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -49,8 +49,10 @@ package Ada.Containers.Ordered_Sets is
    function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
 
    type Set is tagged private;
+   pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
+   pragma Preelaborable_Initialization (Cursor);
 
    Empty_Set : constant Set;
 
index ff06e9801a06fe82f67e08692280aa2a34b8a0b2..fd42ab79cd45e839624d010a133d5dca22d0dd1e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -65,9 +65,13 @@ package Ada.Exceptions is
    --  pragma, which is fine for the bootstrap.
 
    type Exception_Id is private;
+   pragma Preelaborable_Initialization (Exception_Id);
+
    Null_Id : constant Exception_Id;
 
    type Exception_Occurrence is limited private;
+   pragma Preelaborable_Initialization (Exception_Occurrence);
+
    type Exception_Occurrence_Access is access all Exception_Occurrence;
 
    Null_Occurrence : constant Exception_Occurrence;
index 598c29260186a3f2ddba6fe4eef8cd2811da1348..a663a0696dcd938a51d4e36c75918431ce74ef73 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -41,12 +41,14 @@ package Ada.Finalization is
    pragma Preelaborate;
 
    type Controlled is abstract tagged private;
+   pragma Preelaborable_Initialization (Controlled);
 
    procedure Initialize (Object : in out Controlled);
    procedure Adjust     (Object : in out Controlled);
    procedure Finalize   (Object : in out Controlled);
 
    type Limited_Controlled is abstract tagged limited private;
+   pragma Preelaborable_Initialization (Controlled);
 
    procedure Initialize (Object : in out Limited_Controlled);
    procedure Finalize   (Object : in out Limited_Controlled);
index 33e818a68241595f24541f8890eb5b6d9381d5c4..a5c9de981aa01598b8a0f940859141a9e26512d4 100644 (file)
@@ -48,6 +48,7 @@ package Ada.Numerics.Generic_Complex_Types is
    pragma Complex_Representation (Complex);
 
    type Imaginary is private;
+   pragma Preelaborable_Initialization (Imaginary);
 
    i : constant Imaginary;
    j : constant Imaginary;
index d0dbe8c9ce02614a7a96068a913d7a50f396daa2..089bb28888fc60ef648de557222bce371902ca76 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,6 +50,7 @@ package Ada.Strings.Bounded is
       Max_Length : constant Positive := Max;
 
       type Bounded_String is private;
+      pragma Preelaborable_Initialization (Bounded_String);
 
       Null_Bounded_String : constant Bounded_String;
 
index ce3c335e71fc190e7c1b3e336d8cbd5163741b6d..793cb01c04814a424b98907fa4c04ee35255b256 100644 (file)
@@ -39,6 +39,7 @@ package Ada.Streams is
    pragma Pure;
 
    type Root_Stream_Type is abstract tagged limited private;
+   pragma Preelaborable_Initialization (Root_Stream_Type);
 
    type Stream_Element is mod 2 ** Standard'Storage_Unit;
 
index bd1b98f00cc80fdfea5365b94bfdd27050fe274c..e2a9c1d594a58380aa279159879a2cd4cdbf8c8e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -47,6 +47,7 @@ package Ada.Strings.Maps is
    --------------------------------
 
    type Character_Set is private;
+   pragma Preelaborable_Initialization (Character_Set);
    --  Representation for a set of character values:
 
    Null_Set : constant Character_Set;
@@ -107,6 +108,7 @@ package Ada.Strings.Maps is
    ------------------------------------
 
    type Character_Mapping is private;
+   pragma Preelaborable_Initialization (Character_Mapping);
    --  Representation for a character to character mapping:
 
    function Value
index 5755ed202aa0e9b6d725f9f8b5f35d8e5e838e36..a213f0b37e246da744db5cea0fcab7df7bc8de2a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -42,6 +42,7 @@ package Ada.Strings.Unbounded is
    pragma Preelaborate;
 
    type Unbounded_String is private;
+   pragma Preelaborable_Initialization (Unbounded_String);
 
    Null_Unbounded_String : constant Unbounded_String;
 
@@ -426,10 +427,4 @@ private
                              (AF.Controlled with
                                 Reference => Null_String'Access,
                                 Last => 0);
-   --  Note: this declaration is illegal since library level controlled
-   --  objects are not allowed in preelaborated units. See AI-161 for a
-   --  discussion of this issue and an attempt to address it. Meanwhile,
-   --  what happens in GNAT is that this check is omitted for internal
-   --  implementation units (see check in sem_cat.adb).
-
 end Ada.Strings.Unbounded;
index 4033543e866faeab17539e635751fae5bb82df0e..7717272420cf0b4eac20232015e01e8ea046acae 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,6 +50,7 @@ package Ada.Strings.Wide_Bounded is
       Max_Length : constant Positive := Max;
 
       type Bounded_Wide_String is private;
+      pragma Preelaborable_Initialization (Bounded_Wide_String);
 
       Null_Bounded_Wide_String : constant Bounded_Wide_String;
 
index 812de22b2bd7cc7d9da0b7f4cb1f2c907b4e91a9..a745574dc840e99ab84dcf172ee6d1794d0e744d 100644 (file)
@@ -45,6 +45,7 @@ package Ada.Strings.Wide_Maps is
    -------------------------------------
 
    type Wide_Character_Set is private;
+   pragma Preelaborable_Initialization (Wide_Character_Set);
    --  Representation for a set of Wide_Character values:
 
    Null_Set : constant Wide_Character_Set;
@@ -122,6 +123,7 @@ package Ada.Strings.Wide_Maps is
    -----------------------------------------
 
    type Wide_Character_Mapping is private;
+   pragma Preelaborable_Initialization (Wide_Character_Mapping);
    --  Representation for a wide character to wide character mapping:
 
    function Value
index 4ac93acc84c285cb1dfa23ea0b97af3af3aeef93..a7a967f1d35b8e307ac078dee2da1fc67e6ecc4b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -42,6 +42,7 @@ package Ada.Strings.Wide_Unbounded is
    pragma Preelaborate;
 
    type Unbounded_Wide_String is private;
+   pragma Preelaborable_Initialization (Unbounded_Wide_String);
 
    Null_Unbounded_Wide_String : constant Unbounded_Wide_String;
 
@@ -432,10 +433,4 @@ private
                                   (AF.Controlled with
                                      Reference => Null_Wide_String'Access,
                                      Last => 0);
-   --  Note: this declaration is illegal since library level controlled
-   --  objects are not allowed in preelaborated units. See AI-161 for a
-   --  discussion of this issue and an attempt to address it. Meanwhile,
-   --  what happens in GNAT is that this check is omitted for internal
-   --  implementation units (see check in sem_cat.adb).
-
 end Ada.Strings.Wide_Unbounded;
index 7650ef58aa9860567d87d9525a58e67cf53c303f..0490147e7844ecef3b3cfe4b769e4ddb1bcc5aca 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,6 +50,7 @@ package Ada.Strings.Wide_Wide_Bounded is
       Max_Length : constant Positive := Max;
 
       type Bounded_Wide_Wide_String is private;
+      pragma Preelaborable_Initialization (Bounded_Wide_Wide_String);
 
       Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String;
 
index d79b0f9844b3709d8431104f69b807171eadc279..9083113237d96b946d5543535b95ee8fdd2a5e33 100644 (file)
@@ -45,6 +45,7 @@ package Ada.Strings.Wide_Wide_Maps is
    ------------------------------------------
 
    type Wide_Wide_Character_Set is private;
+   pragma Preelaborable_Initialization (Wide_Wide_Character_Set);
    --  Representation for a set of Wide_Wide_Character values:
 
    Null_Set : constant Wide_Wide_Character_Set;
@@ -122,6 +123,7 @@ package Ada.Strings.Wide_Wide_Maps is
    ----------------------------------------------
 
    type Wide_Wide_Character_Mapping is private;
+   pragma Preelaborable_Initialization (Wide_Wide_Character_Mapping);
    --  Representation for a wide character to wide character mapping:
 
    function Value
index 95b8eb172690ae07a11540b25c78e2757dd3af1d..361e2f627ff659c5ded660d41cb06e8aa75eaeb5 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -42,6 +42,7 @@ package Ada.Strings.Wide_Wide_Unbounded is
    pragma Preelaborate;
 
    type Unbounded_Wide_Wide_String is private;
+   pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String);
 
    Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String;
 
@@ -441,10 +442,4 @@ private
                                           Reference =>
                                             Null_Wide_Wide_String'Access,
                                           Last => 0);
-   --  Note: this declaration is illegal since library level controlled
-   --  objects are not allowed in preelaborated units. See AI-161 for a
-   --  discussion of this issue and an attempt to address it. Meanwhile,
-   --  what happens in GNAT is that this check is omitted for internal
-   --  implementation units (see check in sem_cat.adb).
-
 end Ada.Strings.Wide_Wide_Unbounded;
index acef0f1375df9bb56132f94cae19ff0b34fa736c..7bd560a86f2668810b7e7327e2d0b3f56a1887a7 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -43,6 +43,7 @@ package Ada.Task_Identification is
    --  In accordance with Ada 2005 AI-362
 
    type Task_Id is private;
+   pragma Preelaborable_Initialization (Task_Id);
 
    Null_Task_Id : constant Task_Id;
 
index 420f9693b3d9df903159ccb172a76b469fa15b7d..069474f508d9341a24c8f70503c4774d49548b7a 100644 (file)
@@ -748,6 +748,22 @@ package body Lib is
       end if;
    end In_Extended_Main_Source_Unit;
 
+   ------------------------
+   -- In_Predefined_Unit --
+   ------------------------
+
+   function In_Predefined_Unit (N : Node_Or_Entity_Id) return Boolean is
+   begin
+      return In_Predefined_Unit (Sloc (N));
+   end In_Predefined_Unit;
+
+   function In_Predefined_Unit (S : Source_Ptr) return Boolean is
+      Unit : constant Unit_Number_Type := Get_Source_Unit (S);
+      File : constant File_Name_Type   := Unit_File_Name (Unit);
+   begin
+      return Is_Predefined_File_Name (File);
+   end In_Predefined_Unit;
+
    -----------------------
    -- In_Same_Code_Unit --
    -----------------------
index e02555ade650f0db654e14bb71538a1eeeb6019f..67978da253704aea83c40242d438f7b05647db04 100644 (file)
@@ -491,8 +491,15 @@ package Lib is
    --  and the parent unit spec if it is separate.
 
    function In_Extended_Main_Source_Unit (Loc : Source_Ptr) return Boolean;
-   --  Same function as above, but argument is a source pointer rather
-   --  than a node.
+   --  Same function as above, but argument is a source pointer
+
+   function In_Predefined_Unit (N : Node_Or_Entity_Id) return Boolean;
+   --  Returns True if the given node or entity appears within the source text
+   --  of a predefined unit (i.e. within Ada, Interfaces, System or within one
+   --  of the descendent packages of one of these three packages).
+
+   function In_Predefined_Unit (S : Source_Ptr) return Boolean;
+   --  Same function as above but argument is a source pointer
 
    function Earlier_In_Extended_Unit (S1, S2 : Source_Ptr) return Boolean;
    --  Given two Sloc values  for which In_Same_Extended_Unit is true,