]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Task arrays trigger spurious unreferenced warnings
authorJustin Squirek <squirek@adacore.com>
Tue, 28 Dec 2021 19:32:51 +0000 (19:32 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 11 Jan 2022 13:24:49 +0000 (13:24 +0000)
gcc/ada/

* sem_warn.adb (Check_References): Add call to Has_Task instead
of checking component type.

gcc/ada/sem_warn.adb

index 72627af6121bde0409e45b7615771cc0dc3c5048..e02f6e04947b90fe4b3b52c968ecb4754cb2caff 100644 (file)
@@ -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.