From e2e877266de127fbcd6f14e85e0c46ce4731c207 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 22 Nov 2021 12:11:46 +0100 Subject: [PATCH] [Ada] Remove duplicated condition in warnings about read-before-write gcc/ada/ * sem_warn.adb (Check_References): Remove redundant condition. --- gcc/ada/sem_warn.adb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index d9d5d9583150..3d7e4124e0ae 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1569,15 +1569,13 @@ package body Sem_Warn is -- For access types, UR was only set for dereferences, -- so the issue is that the value may be null. - if not Is_Trivial_Subprogram (Scope (E1)) then - if not Warnings_Off_E1 then - if Is_Access_Type (Etype (Parent (UR))) then - Error_Msg_N ("??`&.&` may be null!", UR); - else - Error_Msg_N - ("??`&.&` may be referenced before " - & "it has a value!", UR); - end if; + if not Warnings_Off_E1 then + if Is_Access_Type (Etype (Parent (UR))) then + Error_Msg_N ("??`&.&` may be null!", UR); + else + Error_Msg_N + ("??`&.&` may be referenced before " + & "it has a value!", UR); end if; end if; -- 2.47.2