From: Ghjuvan Lacambre Date: Thu, 23 Jul 2020 07:51:43 +0000 (+0200) Subject: [Ada] Disable warnings on entities when building finalizers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54c49fcdd7064b20b557f1027ae03c9eac2b07d4;p=gcc.git [Ada] Disable warnings on entities when building finalizers gcc/ada/ * exp_ch7.adb (Build_Finalizer): Disable warnings on referenced entity. --- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 1264eebeb85..b58a3c1d224 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -3157,6 +3157,14 @@ package body Exp_Ch7 is Append_To (Finalizer_Stmts, Label); + -- Disable warnings on Obj_Id. This works around an issue where GCC + -- is not able to detect that Obj_Id is protected by a counter and + -- emits spurious warnings. + + if not Comes_From_Source (Obj_Id) then + Set_Warnings_Off (Obj_Id); + end if; + -- Processing for simple protected objects. Such objects require -- manual finalization of their lock managers.