public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5726] [Ada] Remove duplicated condition in warnings about read-before-write
@ 2021-12-02 16:28 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-12-02 16:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e2e877266de127fbcd6f14e85e0c46ce4731c207
commit r12-5726-ge2e877266de127fbcd6f14e85e0c46ce4731c207
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Mon Nov 22 12:11:46 2021 +0100
[Ada] Remove duplicated condition in warnings about read-before-write
gcc/ada/
* sem_warn.adb (Check_References): Remove redundant condition.
Diff:
---
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 d9d5d958315..3d7e4124e0a 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-02 16:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 16:28 [gcc r12-5726] [Ada] Remove duplicated condition in warnings about read-before-write Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).