aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-10-07 23:19:28 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-24 05:16:04 -0500
commit218079efc59095aa07da7f4f2a7a50b07f35f66e (patch)
treecd38c4fbff10cfb42e049695e018880c56aebba9
parent4f94320340e621e0b32e26f5e5b4d8883c7f8241 (diff)
downloadgcc-218079efc59095aa07da7f4f2a7a50b07f35f66e.zip
gcc-218079efc59095aa07da7f4f2a7a50b07f35f66e.tar.gz
gcc-218079efc59095aa07da7f4f2a7a50b07f35f66e.tar.bz2
[Ada] Accept local objects in the prefix of attribute Loop_Entry
gcc/ada/ * sem_attr.adb (Declared_Within): Return True for objects declared within the attribute Loop_Entry prefix itself.
-rw-r--r--gcc/ada/sem_attr.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index ee65185..0fdc830 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4375,7 +4375,8 @@ package body Sem_Attr is
-- within the related loop.
function Declared_Within (Nod : Node_Id) return Boolean;
- -- Determine whether Nod appears in the subtree of Loop_Decl
+ -- Determine whether Nod appears in the subtree of Loop_Decl but
+ -- not within the subtree of the prefix P itself.
---------------------
-- Check_Reference --
@@ -4411,6 +4412,9 @@ package body Sem_Attr is
if Stmt = Loop_Decl then
return True;
+ elsif Stmt = P then
+ return False;
+
-- Prevent the search from going too far
elsif Is_Body_Or_Package_Declaration (Stmt) then