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.
("?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