[Ada] Fix spurious error on checking of null Abstract_State

2020-05-25  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_util.adb (Check_No_Hidden_State): Stop propagation at
	first block/task/entry.
This commit is contained in:
Yannick Moy 2019-12-11 17:39:07 +01:00 committed by Pierre-Marie de Rodat
parent 1a14bfbd78
commit 431e762fae
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2020-05-25 Yannick Moy <moy@adacore.com>
* sem_util.adb (Check_No_Hidden_State): Stop propagation at
first block/task/entry.
2020-05-25 Yannick Moy <moy@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Document

View File

@ -3387,10 +3387,14 @@ package body Sem_Util is
return;
-- Objects and states that appear immediately within a subprogram or
-- inside a construct nested within a subprogram do not introduce a
-- hidden state. They behave as local variable declarations.
-- entry inside a construct nested within a subprogram do not
-- introduce a hidden state. They behave as local variable
-- declarations. The same is true for elaboration code inside a block
-- or a task.
elsif Is_Subprogram (Context) then
elsif Is_Subprogram_Or_Entry (Context)
or else Ekind_In (Context, E_Block, E_Task_Type)
then
return;
-- When examining a package body, use the entity of the spec as it