diff options
author | Justin Squirek <squirek@adacore.com> | 2021-12-28 19:32:51 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-11 13:24:49 +0000 |
commit | 1be42e5907524af490afdec8ff2e200e69bfa8aa (patch) | |
tree | 0704e542db148953c0159ef0122f1ce2ac62516a /gcc | |
parent | ce263de61fb0817d4d5adcb740e1b08dbd7bb6b4 (diff) | |
download | gcc-1be42e5907524af490afdec8ff2e200e69bfa8aa.zip gcc-1be42e5907524af490afdec8ff2e200e69bfa8aa.tar.gz gcc-1be42e5907524af490afdec8ff2e200e69bfa8aa.tar.bz2 |
[Ada] Task arrays trigger spurious unreferenced warnings
gcc/ada/
* sem_warn.adb (Check_References): Add call to Has_Task instead
of checking component type.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_warn.adb | 9 |
1 files changed, 3 insertions, 6 deletions
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. |