From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 456583857719; Tue, 20 Jun 2023 07:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 456583857719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687247212; bh=OY42qSNC1B3wenTa6EwJt5ibaUN9sG4j4zRW9COMAPg=; h=From:To:Subject:Date:From; b=oxlkvqnujlIXdsE/dyroLSFwEeD/cOEhdYyPywW/U1Ef/ZT3RcT2YK/NkwkNh7uXu Kh2vtmS10MJJj0bs9TmLJBJhjVwFRm2g4PbbQlYTmqIAjlZGkPwizSWQcxlSPkwBOe ksoE6MJupWbT9USoVBaXUVKcmsRUQb8VjTjtcZjc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1973] ada: Fix for quantified expressions in Exceptional_Cases X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 970ee828e75fb3f67a7dc8dd8108e9a2f23b997b X-Git-Newrev: 86f03e37d6e5b601e663b9339aacb9bd22d7d4b4 Message-Id: <20230620074652.456583857719@sourceware.org> Date: Tue, 20 Jun 2023 07:46:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:86f03e37d6e5b601e663b9339aacb9bd22d7d4b4 commit r14-1973-g86f03e37d6e5b601e663b9339aacb9bd22d7d4b4 Author: Piotr Trojanek Date: Thu Jun 1 09:59:40 2023 +0200 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. Diff: --- gcc/ada/sem_res.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 266cf8e559e..6867c8f1275 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