-2019-10-10 Ed Schonberg <schonberg@adacore.com>
+2019-10-10 Gary Dismukes <dismukes@adacore.com>
- * sem_ch12.adb (Analyze_Formal_Package_Declaration): Propagate
- an aspect specification for Abstract_State from generic package
- to formal package, so that it is available when analyzing the
- constructed formal.
\ No newline at end of file
+ * sem_util.adb (Enclosing_Subprogram): Handle the case of
+ E_Entry_Family, returning the entry family's associated
+ Protected_Body_Subprogram (as was already done for E_Entry).
+ * exp_ch9.adb (Expand_N_Accept_Statement): Call Reset_Scopes_To
+ on the block created for an accept statement to reset the scopes
+ of any local entities to the block scope.
\ No newline at end of file
Declarations => Declarations (N),
Handled_Statement_Sequence => Build_Accept_Body (N));
+ -- Reset the Scope of local entities associated with the accept
+ -- statement (that currently reference the entry scope) to the
+ -- block scope, to avoid having references to the locals treated
+ -- as up-level references.
+
+ Reset_Scopes_To (Block, Blkent);
+
-- For the analysis of the generated declarations, the parent node
-- must be properly set.
elsif Ekind_In (Dyn_Scop, E_Block, E_Loop, E_Return_Statement) then
return Enclosing_Subprogram (Dyn_Scop);
- elsif Ekind (Dyn_Scop) = E_Entry then
+ elsif Ekind_In (Dyn_Scop, E_Entry, E_Entry_Family) then
- -- For a task entry, return the enclosing subprogram of the
- -- task itself.
+ -- For a task entry or entry family, return the enclosing subprogram
+ -- of the task itself.
if Ekind (Scope (Dyn_Scop)) = E_Task_Type then
return Enclosing_Subprogram (Dyn_Scop);
- -- A protected entry is rewritten as a protected procedure which is
- -- the desired enclosing subprogram. This is relevant when unnesting
- -- a procedure local to an entry body.
+ -- A protected entry or entry family is rewritten as a protected
+ -- procedure which is the desired enclosing subprogram. This is
+ -- relevant when unnesting a procedure local to an entry body.
else
return Protected_Body_Subprogram (Dyn_Scop);