From: Ronan Desplanques Date: Mon, 31 Mar 2025 11:44:53 +0000 (+0200) Subject: ada: Rewrite boolean expression X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=476040327638c3a53067e690e026d3629cc19ac3;p=thirdparty%2Fgcc.git 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 --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 1bc97a85103..74f9fe304df 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.