[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:
parent
1a14bfbd78
commit
431e762fae
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user