usage.adb: Add missing lines for -gnat95 and -gnat05 switches
authorRobert Dewar <dewar@adacore.com>
Tue, 15 Mar 2005 16:19:12 +0000 (17:19 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Mar 2005 16:19:12 +0000 (17:19 +0100)
2005-03-08  Robert Dewar  <dewar@adacore.com>

* usage.adb: Add missing lines for -gnat95 and -gnat05 switches

* sem_ch7.adb: Minor change to propagate Is_Ada_2005 flag

* i-c.adb: Clarify that AI-258 behavior is also intended in Ada 95

From-SVN: r96511

gcc/ada/i-c.adb
gcc/ada/sem_ch7.adb
gcc/ada/usage.adb

index da8e3146f66606874063bafe86ee2dcf288922ee..250344977b5c3e1144d8252dfc4beb5cc5d2a3e8 100644 (file)
@@ -504,7 +504,8 @@ package body Interfaces.C is
          --  char_array. The lower bound of this array is required to be zero
          --  (RM B.3(50)) but that is of course impossible given that size_t
          --  is unsigned. According to Ada 2005 AI-258, the result is to raise
-         --  Constraint_Error.
+         --  Constraint_Error. This is also the appropriate behavior in Ada 95,
+         --  since nothing else makes sense.
 
          if Item'Length = 0 then
             raise Constraint_Error;
@@ -593,7 +594,8 @@ package body Interfaces.C is
          --  wchar_array. The lower bound of this array is required to be zero
          --  (RM B.3(50)) but that is of course impossible given that size_t
          --  is unsigned. According to Ada 2005 AI-258, the result is to raise
-         --  Constraint_Error.
+         --  Constraint_Error. This is also the appropriate behavior in Ada 95,
+         --  since nothing else makes sense.
 
          if Item'Length = 0 then
             raise Constraint_Error;
@@ -680,7 +682,8 @@ package body Interfaces.C is
          --  char16_array. The lower bound of this array is required to be zero
          --  (RM B.3(50)) but that is of course impossible given that size_t
          --  is unsigned. According to Ada 2005 AI-258, the result is to raise
-         --  Constraint_Error.
+         --  Constraint_Error. This is also the appropriate behavior in Ada 95,
+         --  since nothing else makes sense.
 
          if Item'Length = 0 then
             raise Constraint_Error;
index b56917d4badfd77943b585273eb5ed17987fcb85..cf1cc2f502538f5d6492a900b3c11c22b9269b6a 100644 (file)
@@ -1685,6 +1685,8 @@ package body Sem_Ch7 is
                                                                       (Full));
          Set_Is_Volatile       (Priv, Is_Volatile       (Full));
          Set_Treat_As_Volatile (Priv, Treat_As_Volatile (Full));
+         Set_Is_Ada_2005       (Priv, Is_Ada_2005       (Full));
+         --  Why is atomic not copied here ???
 
          if Referenced (Full) then
             Set_Referenced (Priv);
index 4441490ac0c98e3e81d1fe88ba83c8eb5ad5d714..64bb0b1c89259b1c5a44ae0fa86ba2cff631e45f 100644 (file)
@@ -26,6 +26,7 @@
 
 with Hostparm;
 with Namet;          use Namet;
+with Opt;            use Opt;
 with Osint;          use Osint;
 with Output;         use Output;
 with System.WCh_Con; use System.WCh_Con;
@@ -466,9 +467,24 @@ begin
    Write_Switch_Char ("83");
    Write_Line ("Enforce Ada 83 restrictions");
 
+   --  Line for -gnat95 switch
+
+   Write_Switch_Char ("95");
+
+   if Ada_Version_Default = Ada_95 then
+      Write_Line ("Ada 95 mode (default)");
+   else
+      Write_Line ("Enforce Ada 95 restrictions");
+   end if;
+
    --  Line for -gnat05 switch
 
    Write_Switch_Char ("05");
-   Write_Line ("Allow Ada 2005 extensions");
+
+   if Ada_Version_Default = Ada_05 then
+      Write_Line ("Ada 2005 mode (default)");
+   else
+      Write_Line ("Allow Ada 2005 extensions");
+   end if;
 
 end Usage;