From: Viljar Indus Date: Fri, 1 Aug 2025 06:28:13 +0000 (+0300) Subject: ada: The policy of a generic can be different within a instantiation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdb29aa4e543d47da6ebdc968b7bcff6ebae172b;p=thirdparty%2Fgcc.git ada: The policy of a generic can be different within a instantiation gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Policy): ignore ghost policy changes within instantiation statements. --- diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index 6e843bda957..31d171dee00 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -843,12 +843,14 @@ package body Ghost is Applic_Policy : Ghost_Mode_Type := Ghost_Config.Ghost_Mode; Ghost_Region : constant Node_Id := Ghost_Config.Current_Region; begin - -- Ghost entities can be referenced inside a renaming declaration if - -- used within a renaming declaration. + -- The policy is allowed to change within renaming and instantiation + -- statements. if No (Ghost_Region) or else Nkind (Ghost_Region) in N_Object_Renaming_Declaration + | N_Package_Instantiation + | N_Procedure_Instantiation | N_Subprogram_Renaming_Declaration then return;