+2016-04-20 Gary Dismukes <dismukes@adacore.com>
+
+ * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
+ reformatting.
+
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
+ If the pragma comes from an aspect specification, verify that
+ the aspect applies to an entity with a declarative part.
+ * exp_ch5.adb: Code cleanup.
+
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Resolve_If_Expression): If first expression is
+ universal, resolve subsequent ones with the corresponding class
+ type (Any_Integer or Any_Real).
+
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
+ disabled, complete the analysis of the iterator name to ensure
+ that reference for entities within are properly generated.
+
+2016-04-20 Arnaud Charlet <charlet@adacore.com>
+
+ * a-dispat.ads (Yield): add Global contract.
+ * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
+ * a-taside.adb: Added Initializes => Tasking_State.
+
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Build_Invariant_Procedure):
SPARK_Mode,
Abstract_State => (Clock_Time with Synchronous,
External => (Async_Readers,
- Async_Writers))
+ Async_Writers)),
+ Initializes => Clock_Time
is
type Time is private;
package Ada.Dispatching is
pragma Preelaborate (Dispatching);
- procedure Yield;
+ procedure Yield with
+ Global => null;
Dispatching_Policy_Error : exception;
end Ada.Dispatching;
SPARK_Mode,
Abstract_State => (Clock_Time with Synchronous,
External => (Async_Readers,
- Async_Writers))
+ Async_Writers)),
+ Initializes => Clock_Time
is
pragma Compile_Time_Error
SPARK_Mode,
Abstract_State => (Tasking_State with Synchronous,
External => (Async_Readers,
- Async_Writers))
+ Async_Writers)),
+ Initializes => Tasking_State
is
pragma Preelaborate;
-- In accordance with Ada 2005 AI-362
-- subprogram. In restricted profiles this is not available.
if Nkind (Ent) = N_Function_Call
- and then RTE_Available (RE_Get_Ceiling)
+ and then not Configurable_Run_Time_Mode
and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling)
or else
Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling))
when others =>
if T.C2 = '?' then
- -- This in not a logical operator: start looking for
+ -- This is not a logical operator: start looking for
-- nested decisions from here. Recurse over the left
-- child and let the loop take care of the right one.
when others =>
if T.C2 = '?' and then Process_Nested_Decisions then
- -- This in not a logical operator: start looking for
+ -- This is not a logical operator: start looking for
-- nested decisions from here. Recurse over the left
-- child and let the loop take care of the right one.
Statements => Stmts));
-- The processing of an invariant pragma immediately generates the
- -- invariant procedure spec, inserts it into the tree and analyzes
+ -- invariant procedure spec, inserts it into the tree, and analyzes
-- it. If the spec has not been analyzed, then the invariant pragma
-- is being inherited and requires manual insertion and analysis.
end if;
-- Otherwise there are no private declarations. This is either an
- -- error or the related type is a private extension in which case
+ -- error or the related type is a private extension, in which case
-- it does not need a completion in a private part. Insert the body
- -- and the end of the visible declarations and analyze immediately
+ -- at the end of the visible declarations and analyze immediately
-- because the related type is about to be frozen.
else
-- Do not perform this expansion in SPARK mode, since the formal
-- verification directly deals with the source form of the iterator.
- -- Ditto for ASIS, where the temporary may hide the transformation
- -- of a selected component into a prefixed function call.
+ -- Ditto for ASIS and when expansion is disabled,, where the temporary
+ -- may hide the transformation of a selected component into a prefixed
+ -- function call, and references need to see the original expression.
and then not GNATprove_Mode
- and then not ASIS_Mode
+ and then Expander_Active
then
declare
Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
-- Iterate is not a reserved name. What matters is that the return type
-- of the function is an iterator type.
- elsif Is_Entity_Name (Iter_Name) then
+ elsif Is_Entity_Name (Iter_Name) or else not Expander_Active then
Analyze (Iter_Name);
if Nkind (Iter_Name) = N_Function_Call then
-- If that object is a selected component, verify that it is not
-- a component of an unconstrained mutable object.
- if Nkind (Iter_Name) = N_Identifier then
+ if Nkind (Iter_Name) = N_Identifier
+ or else (not Expander_Active and Comes_From_Source (Iter_Name))
+ then
declare
- Orig_Node : constant Node_Id := Original_Node (Iter_Name);
+ Orig_Node : constant Node_Id := Original_Node (Iter_Name);
Iter_Kind : constant Node_Kind := Nkind (Orig_Node);
Obj : Node_Id;
Check_Is_In_Decl_Part_Or_Package_Spec;
end if;
+ if From_Aspect_Specification (N) then
+ declare
+ E : constant Entity_Id := Entity (Corresponding_Aspect (N));
+ begin
+ if not In_Open_Scopes (E) then
+ Error_Msg_N
+ ("aspect must apply to package or subprogram", N);
+ end if;
+ end;
+ end if;
+
if Present (Arg1) then
Pool := Get_Pragma_Arg (Arg1);
end if;
-- If ELSE expression present, just resolve using the determined type
+ -- If type is universal, resolve to any member of the class.
if Present (Else_Expr) then
- Resolve (Else_Expr, Typ);
+ if Typ = Universal_Integer then
+ Resolve (Else_Expr, Any_Integer);
+
+ elsif Typ = Universal_Real then
+ Resolve (Else_Expr, Any_Real);
+
+ else
+ Resolve (Else_Expr, Typ);
+ end if;
+
Else_Typ := Etype (Else_Expr);
if Is_Scalar_Type (Else_Typ) and then Else_Typ /= Typ then
-- See if we need elaboration entity.
- -- We always need an elaboration entity when preserving control-flow, as
- -- we want to remain explicit about the units elaboration order.
+ -- We always need an elaboration entity when preserving control flow, as
+ -- we want to remain explicit about the unit's elaboration order.
elsif Opt.Suppress_Control_Flow_Optimizations then
null;