Message ID | 20220110094131.GA585995@adacore.com |
---|---|
State | New |
Headers | show |
Series | [Ada] Task arrays trigger spurious unreferenced warnings | expand |
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb --- 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.