From: Arnaud Charlet Date: Thu, 11 Feb 2021 13:08:35 +0000 (+0100) Subject: [Ada] Fix handling of scopes for subprogram calls in unnesting X-Git-Tag: basepoints/gcc-13~6841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cee20bb1ebbe66d4065c33da9f8743683228ede;p=thirdparty%2Fgcc.git [Ada] Fix handling of scopes for subprogram calls in unnesting gcc/ada/ * exp_unst.adb (Unnest_Subprogram.Build_Table.Visit_Node): Fix handling of scopes for subprogram calls. --- diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 6fd7a0ec6b9d..52d6142f20dc 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -883,7 +883,7 @@ package body Exp_Unst is -- within Subp. Calls to Subp itself or to subprograms -- outside the nested structure do not affect us. - if Scope_Within (Ent, Subp) + if Scope_Within (Ultimate_Alias (Ent), Subp) and then Is_Subprogram (Ent) and then not Is_Imported (Ent) then