For subprograms we call Warn_On_Overlapping_Actuals in Resolve_Call;
however, for protected entries we didn't call it at all, because
Resolve_Call was executing Resolve_Entry_Call and returning early. As a
result, we didn't detect overlapping actuals in entry calls. Now we do.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-12  Piotr Trojanek  <troja...@adacore.com>

gcc/ada/

        * sem_res.adb (Resolve_Entry_Call): Add call to
        Warn_On_Overlapping_Actuals.
--- gcc/ada/sem_res.adb
+++ gcc/ada/sem_res.adb
@@ -8090,6 +8090,13 @@ package body Sem_Res is
       then
          Establish_Transient_Scope (N, Manage_Sec_Stack => True);
       end if;
+
+      --  Now we know that this is not a call to a function that returns an
+      --  array type; moreover, we know the name of the called entry. Detect
+      --  overlapping actuals, just like for a subprogram call.
+
+      Warn_On_Overlapping_Actuals (Nam, N);
+
    end Resolve_Entry_Call;
 
    -------------------------

Reply via email to