From b942847f787fc5765bdae95550ddf0de690b225c Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Thu, 23 Dec 2021 04:09:05 +0000 Subject: [PATCH] [Ada] Task arrays trigger spurious unreferenced warnings gcc/ada/ * sem_warn.adb (Check_References): Handle arrays of tasks similar to task objects. --- gcc/ada/sem_warn.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 85d5365ba103..63a5406e40e8 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. -- 2.47.2