aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-11-22 12:11:46 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-12-02 16:26:22 +0000
commite2e877266de127fbcd6f14e85e0c46ce4731c207 (patch)
treec0f21690a8c0791e6ba461ddcdca3dc49eafc590 /gcc
parent28acd56a7a66f79be3372af00175483d00b4615e (diff)
downloadgcc-e2e877266de127fbcd6f14e85e0c46ce4731c207.zip
gcc-e2e877266de127fbcd6f14e85e0c46ce4731c207.tar.gz
gcc-e2e877266de127fbcd6f14e85e0c46ce4731c207.tar.bz2
[Ada] Remove duplicated condition in warnings about read-before-write
gcc/ada/ * sem_warn.adb (Check_References): Remove redundant condition.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_warn.adb16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index d9d5d95..3d7e412 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;