aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2019-12-11 17:39:07 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-05-25 10:00:55 -0400
commit431e762fae0faf10c6a115cd4e36d7c8867c5c17 (patch)
treea725d10f7ffd0d7a42a1c046338d396119190755 /gcc
parent1a14bfbd78324a25943998ed1e877e41ec4cd417 (diff)
downloadgcc-431e762fae0faf10c6a115cd4e36d7c8867c5c17.zip
gcc-431e762fae0faf10c6a115cd4e36d7c8867c5c17.tar.gz
gcc-431e762fae0faf10c6a115cd4e36d7c8867c5c17.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_util.adb10
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7c8af5f..4e1b34d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
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
changes to pragmas Compile_Time_Error/Compile_Time_Warning.
* gnat_rm.texi: Regenerate.
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e1703e9..b980b4c 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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