From: Justin Squirek Date: Thu, 23 Dec 2021 04:09:05 +0000 (+0000) Subject: [Ada] Task arrays trigger spurious unreferenced warnings X-Git-Tag: upstream/12.2.0~2307 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b942847f787fc5765bdae95550ddf0de690b225c;p=platform%2Fupstream%2Fgcc.git [Ada] Task arrays trigger spurious unreferenced warnings gcc/ada/ * sem_warn.adb (Check_References): Handle arrays of tasks similar to task objects. --- diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 85d5365..63a5406 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1700,7 +1700,14 @@ package body Sem_Warn is and then ((Ekind (E1) /= E_Variable and then Ekind (E1) /= E_Constant and then Ekind (E1) /= E_Component) - or else not Is_Task_Type (E1T)) + + -- Check that E1T is not a task or an array of them + + or else not + (Is_Task_Type (E1T) + or else (Ekind (E1T) in Array_Kind + and then Is_Task_Type + (Component_Type (E1T))))) -- For subunits, only place warnings on the main unit itself, -- since parent units are not completely compiled.