https://gcc.gnu.org/g:476040327638c3a53067e690e026d3629cc19ac3

commit r16-1441-g476040327638c3a53067e690e026d3629cc19ac3
Author: Ronan Desplanques <desplanq...@adacore.com>
Date:   Mon Mar 31 13:44:53 2025 +0200

    ada: Rewrite boolean expression
    
    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

Diff:
---
 gcc/ada/sem_warn.adb | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 1bc97a851039..74f9fe304dfb 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -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.

Reply via email to