From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 5E9543858437; Tue, 9 Nov 2021 09:46:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E9543858437 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5033] [Ada] Accessibility fix X-Act-Checkin: gcc X-Git-Author: Ghjuvan Lacambre X-Git-Refname: refs/heads/master X-Git-Oldrev: cbe421bd45d1994524b7312ab521dcc8b51cbfc6 X-Git-Newrev: 51e99ead9197fe4d6a8db8e9746e821abce76213 Message-Id: <20211109094656.5E9543858437@sourceware.org> Date: Tue, 9 Nov 2021 09:46:56 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 09:46:56 -0000 https://gcc.gnu.org/g:51e99ead9197fe4d6a8db8e9746e821abce76213 commit r12-5033-g51e99ead9197fe4d6a8db8e9746e821abce76213 Author: Ghjuvan Lacambre Date: Wed Oct 27 13:26:38 2021 +0200 [Ada] Accessibility fix gcc/ada/ * sem_util.adb (Accessibility_Level): Use init_proc_level_formal instead of computing a new accessibility level from Scope_Depth (E). Diff: --- gcc/ada/sem_util.adb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index bc51a60ccf2..c8362f57b17 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -744,6 +744,13 @@ package body Sem_Util is then return Accessibility_Level (Related_Expression (E)); + elsif Level = Dynamic_Level + and then Ekind (E) in E_In_Parameter | E_In_Out_Parameter + and then Present (Init_Proc_Level_Formal (Scope (E))) + then + return New_Occurrence_Of + (Init_Proc_Level_Formal (Scope (E)), Loc); + -- Normal object - get the level of the enclosing scope else