aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2020-07-23 09:51:43 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:44 -0400
commit54c49fcdd7064b20b557f1027ae03c9eac2b07d4 (patch)
tree5ad69069c90eb139d9e6f24ef445a49e1e58eb88 /gcc/ada
parent53ac0963d48588c27dd57257e920c79915b5648b (diff)
downloadgcc-54c49fcdd7064b20b557f1027ae03c9eac2b07d4.zip
gcc-54c49fcdd7064b20b557f1027ae03c9eac2b07d4.tar.gz
gcc-54c49fcdd7064b20b557f1027ae03c9eac2b07d4.tar.bz2
[Ada] Disable warnings on entities when building finalizers
gcc/ada/ * exp_ch7.adb (Build_Finalizer): Disable warnings on referenced entity.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_ch7.adb8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 1264eeb..b58a3c1 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.