]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Rewrite boolean expression
authorRonan Desplanques <desplanques@adacore.com>
Mon, 31 Mar 2025 11:44:53 +0000 (13:44 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Jun 2025 08:37:51 +0000 (10:37 +0200)
This patch rewrites a boolean expression to make it easier to understand
in its context. It also tweaks the surrounding comments.

gcc/ada/ChangeLog:

* sem_warn.adb (Check_References): Rewrite expression

gcc/ada/sem_warn.adb

index 1bc97a851039e482a1672a29c2c37bbd162e40a6..74f9fe304dfb76c6c9315ce108b762b40c74c908 100644 (file)
@@ -1712,17 +1712,11 @@ package body Sem_Warn is
 
               and then Ekind (E1) /= E_Class_Wide_Type
 
-              --  Objects other than parameters of task types are allowed to
-              --  be non-referenced, since they start up tasks.
+              --  Objects that are not parameters and whose types have tasks
+              --  are allowed to be non-referenced since they start up tasks.
 
-              and then ((Ekind (E1) /= E_Variable
-                          and then Ekind (E1) /= E_Constant
-                          and then Ekind (E1) /= E_Component)
-
-                         --  Check that E1T is not a task or a composite type
-                         --  with a task component.
-
-                         or else not Has_Task (E1T))
+              and then not (Ekind (E1) in E_Variable | E_Constant | E_Component
+                            and then Has_Task (E1T))
 
               --  For subunits, only place warnings on the main unit itself,
               --  since parent units are not completely compiled.