From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Piotr Trojanek <trojanek@adacore.com>
Subject: [COMMITTED] ada: Tune style in detection of writable function actuals
Date: Tue, 13 Jun 2023 09:37:42 +0200 [thread overview]
Message-ID: <20230613073742.238961-1-poulhies@adacore.com> (raw)
From: Piotr Trojanek <trojanek@adacore.com>
Cleanup; semantics is unaffected.
gcc/ada/
* sem_util.adb (Check_Function_Writable_Actuals): Tune style; use
subtype name to detect membership test nodes.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index a75ebf5d7b1..237bbd3987c 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2899,6 +2899,10 @@ package body Sem_Util is
function Get_Record_Part (N : Node_Id) return Node_Id;
-- Return the record part of this record type definition
+ ---------------------
+ -- Get_Record_Part --
+ ---------------------
+
function Get_Record_Part (N : Node_Id) return Node_Id is
Type_Def : constant Node_Id := Type_Definition (N);
begin
@@ -3293,9 +3297,7 @@ package body Sem_Util is
& "in unspecified order",
Node (Elmt_2));
- when N_In
- | N_Not_In
- =>
+ when N_Membership_Test =>
Error_Msg_N
("value may be affected by call in other "
& "alternative because they are evaluated "
@@ -3307,7 +3309,7 @@ package body Sem_Util is
("value of actual may be affected by call in "
& "other actual because they are evaluated "
& "in unspecified order",
- Node (Elmt_2));
+ Node (Elmt_2));
end case;
end if;
--
2.40.0
reply other threads:[~2023-06-13 7:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230613073742.238961-1-poulhies@adacore.com \
--to=poulhies@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=trojanek@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).