]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Check all pairs of actuals for overlapping
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 10 Mar 2021 08:26:18 +0000 (09:26 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 17 Jun 2021 14:32:13 +0000 (10:32 -0400)
gcc/ada/

* sem_warn.adb (Warn_On_Overlapping_Actuals): Fix style;
refactor repeated calls to Nkind; remove early RETURN.

gcc/ada/sem_warn.adb

index 6db6d2ccfbed10a2be81441fd25ca985c7cb3e7d..728927433dab7a3166cac88fd7c4c8e74474ac91 100644 (file)
@@ -3693,10 +3693,10 @@ package body Sem_Warn is
 
       --  Local variables
 
-      Act1      : Node_Id;
-      Act2      : Node_Id;
-      Form1     : Entity_Id;
-      Form2     : Entity_Id;
+      Act1  : Node_Id;
+      Act2  : Node_Id;
+      Form1 : Entity_Id;
+      Form2 : Entity_Id;
 
    --  Start of processing for Warn_On_Overlapping_Actuals
 
@@ -3708,9 +3708,7 @@ package body Sem_Warn is
 
       --  Exclude calls rewritten as enumeration literals
 
-      if Nkind (N) not in N_Subprogram_Call
-        and then Nkind (N) /= N_Entry_Call_Statement
-      then
+      if Nkind (N) not in N_Subprogram_Call | N_Entry_Call_Statement then
          return;
       end if;
 
@@ -3879,8 +3877,6 @@ package body Sem_Warn is
                      end if;
                   end if;
                end if;
-
-               return;
             end if;
 
             Next_Formal (Form2);