2014-08-01 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2014 10:22:23 +0000 (10:22 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2014 10:22:23 +0000 (10:22 +0000)
* sem_prag.adb: Minor reformatting.
* s-regpat.adb: Minor reformatting.
* sem_ch3.adb (Analyze_Object_Declaration): Do not set
Treat_As_Volatile on constants.

2014-08-01  Tristan Gingold  <gingold@adacore.com>

* exp_ch9.adb (Make_Task_Create_Call): Improve error message.

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_ch10.adb (Analyze_Compilation_Unit): Do not place a
warning on a with_clause created for the renaming of a parent
unit in an explicit with_clause.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213448 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/ada/s-regpat.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb

index 7f19085..d5606e6 100644 (file)
@@ -1,3 +1,20 @@
+2014-08-01  Robert Dewar  <dewar@adacore.com>
+
+       * sem_prag.adb: Minor reformatting.
+       * s-regpat.adb: Minor reformatting.
+       * sem_ch3.adb (Analyze_Object_Declaration): Do not set
+       Treat_As_Volatile on constants.
+
+2014-08-01  Tristan Gingold  <gingold@adacore.com>
+
+       * exp_ch9.adb (Make_Task_Create_Call): Improve error message.
+
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch10.adb (Analyze_Compilation_Unit): Do not place a
+       warning on a with_clause created for the renaming of a parent
+       unit in an explicit with_clause.
+
 2014-08-01  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch13.adb (Analyze_Aspect_Specifications, case Aspect_Import):
index d01e849..3cacc77 100644 (file)
@@ -14013,6 +14013,20 @@ package body Exp_Ch9 is
       Ttyp := Corresponding_Concurrent_Type (Task_Rec);
       Tnam := Chars (Ttyp);
 
+      --  The sequential partition elaboration policy is supported only in the
+      --  restricted profile.
+
+      --  This test should be in sem_ch9, not here ???
+
+      if Partition_Elaboration_Policy = 'S'
+        and then not Restricted_Profile
+      then
+         Error_Msg_N
+           ("sequential elaboration supported only in restricted profile",
+            Task_Rec);
+         return Make_Null_Statement (Loc);
+      end if;
+
       --  Get task declaration. In the case of a task type declaration, this is
       --  simply the parent of the task type entity. In the single task
       --  declaration, this parent will be the implicit type, and we can find
index 842b6e3..add78bd 100644 (file)
@@ -414,9 +414,9 @@ package body System.Regpat is
          Flags         : out Expression_Flags;
          IP            : out Pointer);
       --  Parse regular expression, i.e. main body or parenthesized thing
-      --  Caller must absorb opening parenthesis.
-      --  Capturing should be set to True when we have an open parenthesis
-      --  from which we want the user to extra text.
+      --  Caller must absorb opening parenthesis. Capturing should be set to
+      --  True when we have an open parenthesis from which we want the user
+      --  to extra text.
 
       procedure Parse_Branch
         (Flags         : out Expression_Flags;
@@ -920,10 +920,13 @@ package body System.Regpat is
                Ender := Emit_Node (CLOSE);
                Emit (Character'Val (Par_No));
                Link_Tail (IP, Ender);
+
             else
-               --  need to keep looking after the closing parenthesis
+               --  Need to keep looking after the closing parenthesis
+
                null;
             end if;
+
          else
             Ender := Emit_Node (EOP);
             Link_Tail (IP, Ender);
@@ -1012,14 +1015,18 @@ package body System.Regpat is
 
                begin
                   if Parse_Pos <= Parse_End - 1
-                     and then Expression (Parse_Pos) = '?'
-                     and then Expression (Parse_Pos + 1) = ':'
+                    and then Expression (Parse_Pos) = '?'
+                    and then Expression (Parse_Pos + 1) = ':'
                   then
                      Parse_Pos := Parse_Pos + 2;
-                     --  non-capturing parenthesis
+
+                     --  Non-capturing parenthesis
+
                      Parse (True, False, New_Flags, IP);
+
                   else
-                     --  capturing parenthesis
+                     --  Capturing parenthesis
+
                      Parse (True, True, New_Flags, IP);
                      Expr_Flags.Has_Width :=
                        Expr_Flags.Has_Width or else New_Flags.Has_Width;
index 3fe718b..13deef6 100644 (file)
@@ -242,7 +242,7 @@ package body Sem_Ch10 is
    --  on the context. Note that in contrast with the handling of private
    --  types, the limited view and the non-limited view of a type are treated
    --  as separate entities, and no entity exchange needs to take place, which
-   --  makes the implementation must simpler than could be feared.
+   --  makes the implementation much simpler than could be feared.
 
    ------------------------------
    -- Analyze_Compilation_Unit --
@@ -507,11 +507,15 @@ package body Sem_Ch10 is
 
             --  Avoid checking implicitly generated with clauses, limited with
             --  clauses or withs that have pragma Elaborate or Elaborate_All.
+            --  With_clauses introduced for renamings of parent clauses are not
+            --  marked implicit because they need to be properly installed, but
+            --  they do not come from source and do not require warnings.
 
             if Nkind (Clause) = N_With_Clause
               and then not Implicit_With (Clause)
               and then not Limited_Present (Clause)
               and then not Elaborate_Present (Clause)
+              and then Comes_From_Source (Clause)
             then
                --  Package body-to-spec check
 
index e9f3061..adbfd50 100644 (file)
@@ -3923,10 +3923,13 @@ package body Sem_Ch3 is
 
       Set_Etype (Id, Act_T);
 
-      --  Object is marked to be treated as volatile if type is volatile and
-      --  we clear the Current_Value setting that may have been set above.
+      --  Non-constant object is marked to be treated as volatile if type is
+      --  volatile and we clear the Current_Value setting that may have been
+      --  set above. Doing so for constants isn't required and might interfere
+      --  with possible uses of the object as a static expression in contexts
+      --  incompatible with volatility (e.g. as a case-statement alternative).
 
-      if Treat_As_Volatile (Etype (Id)) then
+      if Ekind (Id) /= E_Constant and then Treat_As_Volatile (Etype (Id)) then
          Set_Treat_As_Volatile (Id);
          Set_Current_Value (Id, Empty);
       end if;
index ea74779..3aef372 100644 (file)
@@ -7841,8 +7841,7 @@ package body Sem_Prag is
               and then Comes_From_Source
                          (Original_Node (Expression (Parent (Def_Id))))
             then
-
-               --  Set imported flag to prevent cascaded errors.
+               --  Set imported flag to prevent cascaded errors
 
                Set_Is_Imported (Def_Id);