From 1be42e5907524af490afdec8ff2e200e69bfa8aa Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Tue, 28 Dec 2021 19:32:51 +0000 Subject: [Ada] Task arrays trigger spurious unreferenced warnings gcc/ada/ * sem_warn.adb (Check_References): Add call to Has_Task instead of checking component type. --- gcc/ada/sem_warn.adb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 72627af..e02f6e0 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. -- cgit v1.1