aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-06-01 09:59:40 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-20 09:30:49 +0200
commit86f03e37d6e5b601e663b9339aacb9bd22d7d4b4 (patch)
treed7ffda95f08b9d765057b690c3d5b602f29ac3b6 /gcc/ada/sem_res.adb
parent970ee828e75fb3f67a7dc8dd8108e9a2f23b997b (diff)
downloadgcc-86f03e37d6e5b601e663b9339aacb9bd22d7d4b4.zip
gcc-86f03e37d6e5b601e663b9339aacb9bd22d7d4b4.tar.gz
gcc-86f03e37d6e5b601e663b9339aacb9bd22d7d4b4.tar.bz2
ada: Fix for quantified expressions in Exceptional_Cases
When detecting illegal uses of formal parameters of the current subprogram in contract of its Exceptional_Cases, we relied on the Current_Scope. However, quantified expressions introduce an implicit scope, which we need to take into account. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Ignore implicit loop scopes introduced by quantified expressions.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 266cf8e..6867c8f 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -8116,7 +8116,7 @@ package body Sem_Res is
-- data from the object.
if Ekind (E) in E_Out_Parameter | E_In_Out_Parameter
- and then Scope (E) = Current_Scope
+ and then Scope (E) = Current_Scope_No_Loops
and then Within_Exceptional_Cases_Consequence (N)
and then not In_Attribute_Old (N)
and then not (Nkind (Parent (N)) = N_Attribute_Reference