From: Justin Squirek Date: Tue, 28 Dec 2021 19:32:51 +0000 (+0000) Subject: [Ada] Task arrays trigger spurious unreferenced warnings X-Git-Tag: basepoints/gcc-13~1844 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be42e5907524af490afdec8ff2e200e69bfa8aa;p=thirdparty%2Fgcc.git [Ada] Task arrays trigger spurious unreferenced warnings gcc/ada/ * sem_warn.adb (Check_References): Add call to Has_Task instead of checking component type. --- diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 72627af6121b..e02f6e04947b 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1701,13 +1701,10 @@ package body Sem_Warn is and then Ekind (E1) /= E_Constant and then Ekind (E1) /= E_Component) - -- Check that E1T is not a task or an array of them + -- Check that E1T is not a task or a composite type + -- with a task component. - or else not - (Is_Task_Type (E1T) - or else (Ekind (E1T) in Array_Kind - and then Is_Task_Type - (Component_Type (E1T))))) + or else not Has_Task (E1T)) -- For subunits, only place warnings on the main unit itself, -- since parent units are not completely compiled.