From: Ronan Desplanques <desplanq...@adacore.com> 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 Tested on x86_64-pc-linux-gnu, committed on master. --- 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 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. -- 2.43.0