[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 20 Jan 2014 15:25:44 +0000 (16:25 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 20 Jan 2014 15:25:44 +0000 (16:25 +0100)
2014-01-20  Robert Dewar  <dewar@adacore.com>

* s-taasde.ads, gnat_ugn.texi, s-tadeca.adb, sem_res.adb, s-tadeca.ads:
Minor reformatting and code clean up.

2014-01-20  Arnaud Charlet  <charlet@adacore.com>

* sem_cat.adb (Validate_Object_Declaration): Relax semantics
of objects of private type if Relaxed_RM_Semantics.

From-SVN: r206823

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/s-taasde.ads
gcc/ada/s-tadeca.adb
gcc/ada/s-tadeca.ads
gcc/ada/sem_cat.adb
gcc/ada/sem_res.adb

index 9e19e1d7237fa46385a08f6338c870aad0e230cd..cc097b2e7b923756acb0b2a5fde89c26de753de4 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-20  Robert Dewar  <dewar@adacore.com>
+
+       * s-taasde.ads, gnat_ugn.texi, s-tadeca.adb, sem_res.adb, s-tadeca.ads:
+       Minor reformatting and code clean up.
+
+2014-01-20  Arnaud Charlet  <charlet@adacore.com>
+
+       * sem_cat.adb (Validate_Object_Declaration): Relax semantics
+       of objects of private type if Relaxed_RM_Semantics.
+
 2014-01-20  Claire Dross  <dross@adacore.com>
 
        * a-cofove.ads (Vector): Capacity discriminant
index f4a43ed8f7ba2c1b08ee465388ecdf6adc470ec2..32a7e0f0dee64b0a3fdf5ab8013a79154d29eda4 100644 (file)
@@ -13820,7 +13820,7 @@ identifier case conventions, rules of indentation, and comment layout.
 Note: A newly-redesigned set of formatting algorithms used by gnatpp
 is now available.
 To invoke the old formatting algorithms, use the @option{--pp-old} switch.
-We intend to remove support for @option{--pp-old} at some point.
+Support for @option{--pp-old} will be removed in some future version.
 
 To produce a reformatted file, @command{gnatpp} generates and uses the ASIS
 tree for the input source and thus requires the input to be syntactically and
index 80039feeba940773a06673513c209f6433f07647..dc4165a122c47e46f0499802d645951e611135a3 100644 (file)
@@ -81,7 +81,7 @@ package System.Tasking.Async_Delays is
    --              abort_undefer.all;
    --        end;
    --     end if;
-   --
+
    --     if Timed_Out (DB'Unchecked_Access) then
    --        ...continuation for timeout case...
    --     end if;
@@ -108,9 +108,8 @@ package System.Tasking.Async_Delays is
    pragma Inline (Timed_Out);
    --  Return True if the delay specified in D has timed out
 
-   --  There are child units for delays on Ada.Calendar.Time and
-   --  Ada.Real_Time.Time, so that an application will not need to link in
-   --  features that is not using.
+   --  There are child units for delays on Ada.Calendar.Time/Ada.Real_Time.Time
+   --  so that an application need not link in features that it is not using.
 
 private
 
@@ -119,11 +118,10 @@ private
       --  ID of the calling task
 
       Level : ATC_Level_Base;
-      --  Normally Level is the ATC nesting level of the
-      --  async. select statement to which this delay belongs, but
-      --  after a call has been dequeued we set it to
-      --  ATC_Level_Infinity so that the Cancel operation can
-      --  detect repeated calls, and act idempotently.
+      --  Normally Level is the ATC nesting level of the asynchronous select
+      --  statement to which this delay belongs, but after a call has been
+      --  dequeued we set it to ATC_Level_Infinity so that the Cancel operation
+      --  can detect repeated calls, and act idempotently.
 
       Resume_Time : Duration;
       --  The absolute wake up time, represented as Duration
@@ -135,16 +133,15 @@ private
       --  A double linked list
    end record;
 
-   --  The above "overlaying" of Self_ID and Level to hold other
-   --  data that has a non-overlapping lifetime is an unabashed
-   --  hack to save memory.
+   --  The above "overlaying" of Self_ID and Level to hold other data that has
+   --  a non-overlapping lifetime is an unabashed hack to save memory.
 
    procedure Time_Enqueue
      (T : Duration;
       D : Delay_Block_Access);
    pragma Inline (Time_Enqueue);
-   --  Used by the child units to enqueue delays on the timer queue
-   --  implemented in the body of this package. T denotes a point in time as
-   --  the duration elapsed since the epoch of the Ada real-time clock.
+   --  Used by the child units to enqueue delays on the timer queue implemented
+   --  in the body of this package. T denotes a point in time as the duration
+   --  elapsed since the epoch of the Ada real-time clock.
 
 end System.Tasking.Async_Delays;
index fa1ef05e8d7b1fe12f0758168da46230ec923e7d..99fbe1450b31948060db0872a0931b88a7f0eeed 100644 (file)
 ------------------------------------------------------------------------------
 
 with Ada.Calendar.Delays;
+
 with System.OS_Constants;
 with System.OS_Primitives;
 with System.Task_Primitives.Operations;
 with System.Tasking.Initialization;
 
 function System.Tasking.Async_Delays.Enqueue_Calendar
-  (T    : Ada.Calendar.Time;
-   D    : Delay_Block_Access)
-   return Boolean
+  (T : Ada.Calendar.Time;
+   D : Delay_Block_Access) return Boolean
 is
    use type Ada.Calendar.Time;
 
@@ -55,12 +55,13 @@ begin
    end if;
 
    --  T is expressed as a duration elapsed since the UNIX epoch, whereas
-   --  Time_Enque expects duraction elapsed since the epoch of the Ada
-   --  real time clock: compensate if necessary.
+   --  Time_Enque expects duraction elapsed since the epoch of the Ada real-
+   --  time clock: compensate if necessary.
 
-   pragma Warnings (Off);
    --  Comparison "SOSC.CLOCK_RT_Ada = SOSC.CLOCK_REALTIME" is compile
-   --  time known.
+   --  time known, so turn warnings off.
+
+   pragma Warnings (Off);
 
    if SOSC.CLOCK_RT_Ada /= SOSC.CLOCK_REALTIME then
       pragma Warnings (On);
index 81bd4e18a9453cde05897f265e69abcecfb1f140..ac6a270c87eaf20e01f0bca67539abe85e77c1b2 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  S p e c                                 --
 --                                                                          --
---          Copyright (C) 1998-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1998-2013, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -36,6 +36,5 @@
 
 with Ada.Calendar;
 function System.Tasking.Async_Delays.Enqueue_Calendar
-  (T    : Ada.Calendar.Time;
-   D    : Delay_Block_Access)
-   return Boolean;
+  (T : Ada.Calendar.Time;
+   D : Delay_Block_Access) return Boolean;
index 79201c4edf081dc5b6e0f225b6722bf039c2c37d..92979c7ab16bfdc21a67cfe79f93e30fd9dcce13 100644 (file)
@@ -1225,7 +1225,13 @@ package body Sem_Cat is
                   --  means that a pragma Preelaborable_Initialization was
                   --  given for the private type.
 
-                  if Has_Preelaborable_Initialization (Ent) then
+                  if Relaxed_RM_Semantics then
+                     --  In relaxed mode, do not issue these messages, this
+                     --  is basically similar to the GNAT_Mode test below.
+
+                     null;
+
+                  elsif Has_Preelaborable_Initialization (Ent) then
 
                      --  But for the predefined units, we will ignore this
                      --  status unless we are in Ada 2005 mode since we want
index 56b6aeec1e5d3959d0048125de99a5261d855177..6861f1a00b0cc37227e85381ca41b1cd5085dafc 100644 (file)
@@ -2156,20 +2156,6 @@ package body Sem_Res is
                --  First matching interpretation
 
                if not Found then
-                  --  If the current statement is part of a predefined library
-                  --  unit, then all interpretations which come from user level
-                  --  packages should not be considered. User-defined operators
-                  --  may appear anywhere in the homonym list. This exclusion
-                  --  does not apply in an instance, where an actual may come
-                  --  from a local declaration.
-
-                  if From_Lib
-                    and then not Comes_From_Predefined_Lib_Unit (It.Nam)
-                    and then not In_Instance
-                  then
-                     goto Continue;
-                  end if;
-
                   Found := True;
                   I1    := I;
                   Seen  := It.Nam;
@@ -2181,12 +2167,29 @@ package body Sem_Res is
                --  some more obscure cases are handled in Disambiguate.
 
                else
-                  if From_Lib
-                    and then not Comes_From_Predefined_Lib_Unit (It.Nam)
-                  then
-                     goto Continue;
+                  --  If the current statement is part of a predefined library
+                  --  unit, then all interpretations which come from user level
+                  --  packages should not be considered. Check previous and
+                  --  current one.
+
+                  if From_Lib then
+                     if not Comes_From_Predefined_Lib_Unit (It.Nam) then
+                        goto Continue;
+
+                     elsif not Comes_From_Predefined_Lib_Unit (Seen) then
+
+                        --  Previous interpretation must be discarded.
+
+                        I1    := I;
+                        Seen  := It.Nam;
+                        Expr_Type := It.Typ;
+                        Set_Entity (N, Seen);
+                        goto Continue;
+                     end if;
                   end if;
 
+                  --  Otherwise apply further disambiguation steps.
+
                   Error_Msg_Sloc := Sloc (Seen);
                   It1 := Disambiguate (N, I1, I, Typ);