diff options
author | Justin Squirek <squirek@adacore.com> | 2024-04-11 20:51:05 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-10 11:04:00 +0200 |
commit | 7158a64fe920fc5ed14b79459486a58e9718326d (patch) | |
tree | c87b50339f4795cc19933168d246dc12d07f20ca /gcc | |
parent | fd5456235679be9cd00cfd8a56c73219a5fc2576 (diff) | |
download | gcc-7158a64fe920fc5ed14b79459486a58e9718326d.zip gcc-7158a64fe920fc5ed14b79459486a58e9718326d.tar.gz gcc-7158a64fe920fc5ed14b79459486a58e9718326d.tar.bz2 |
ada: Unreferenced warning on abstract subprogram
This patch modifies the unreferenced entity warning in the compiler to avoid
noisily warning about unreferenced abstract subprogram.
gcc/ada/
* sem_warn.adb (Warn_On_Unreferenced_Entity): Add a condition to
ignore warnings on unreferenced abstract subprogram.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_warn.adb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 2de3f86..91a57d5 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -4452,12 +4452,16 @@ package body Sem_Warn is ("?u?literal & is not referenced!", E); when E_Function => - Error_Msg_N -- CODEFIX - ("?u?function & is not referenced!", E); + if not Is_Abstract_Subprogram (E) then + Error_Msg_N -- CODEFIX + ("?u?function & is not referenced!", E); + end if; when E_Procedure => - Error_Msg_N -- CODEFIX - ("?u?procedure & is not referenced!", E); + if not Is_Abstract_Subprogram (E) then + Error_Msg_N -- CODEFIX + ("?u?procedure & is not referenced!", E); + end if; when E_Package => Error_Msg_N -- CODEFIX |