From: Ghjuvan Lacambre Date: Wed, 27 Oct 2021 11:26:38 +0000 (+0200) Subject: [Ada] Accessibility fix X-Git-Tag: basepoints/gcc-13~3280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e99ead9197fe4d6a8db8e9746e821abce76213;p=thirdparty%2Fgcc.git [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 --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index bc51a60ccf2a..c8362f57b177 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