+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):
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
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;
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);
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;
-- 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 --
-- 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
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;
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);