]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove duplicated condition in warnings about read-before-write
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 22 Nov 2021 11:11:46 +0000 (12:11 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 2 Dec 2021 16:26:22 +0000 (16:26 +0000)
gcc/ada/

* sem_warn.adb (Check_References): Remove redundant condition.

gcc/ada/sem_warn.adb

index d9d5d9583150ba8bdc89056ccd4f9269c78b7fdf..3d7e4124e0ae4c0013d2d8fdf4a2ab53096e0c3e 100644 (file)
@@ -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;