]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tune style in detection of writable function actuals
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 20 Mar 2023 19:27:09 +0000 (20:27 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 13 Jun 2023 07:31:42 +0000 (09:31 +0200)
Cleanup; semantics is unaffected.

gcc/ada/

* sem_util.adb (Check_Function_Writable_Actuals): Tune style; use
subtype name to detect membership test nodes.

gcc/ada/sem_util.adb

index a75ebf5d7b16e877bd65098d8e2d8e1f4dc49485..237bbd3987cbfc6eefec72d2fcc613e17dcb806d 100644 (file)
@@ -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;