From: Piotr Trojanek Date: Mon, 22 Nov 2021 11:11:46 +0000 (+0100) Subject: [Ada] Remove duplicated condition in warnings about read-before-write X-Git-Tag: basepoints/gcc-13~2587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2e877266de127fbcd6f14e85e0c46ce4731c207;p=thirdparty%2Fgcc.git [Ada] Remove duplicated condition in warnings about read-before-write gcc/ada/ * sem_warn.adb (Check_References): Remove redundant condition. --- 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;