diff options
author | Justin Squirek <squirek@adacore.com> | 2021-12-23 04:09:05 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-10 09:38:43 +0000 |
commit | b942847f787fc5765bdae95550ddf0de690b225c (patch) | |
tree | d78818f83920d5b212ffe61dd9f4d3d3d2ab40f0 /gcc | |
parent | 3a5702df3f198f264e16479384948fca2931401d (diff) | |
download | gcc-b942847f787fc5765bdae95550ddf0de690b225c.zip gcc-b942847f787fc5765bdae95550ddf0de690b225c.tar.gz gcc-b942847f787fc5765bdae95550ddf0de690b225c.tar.bz2 |
[Ada] Task arrays trigger spurious unreferenced warnings
gcc/ada/
* sem_warn.adb (Check_References): Handle arrays of tasks
similar to task objects.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_warn.adb | 9 |
1 files changed, 8 insertions, 1 deletions
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. |