===================================================================
@@ -7474,6 +7474,15 @@
Index := First (Expressions (Entry_Name));
Resolve (Index, Entry_Index_Type (Nam));
+ -- Generate a reference for the index entity when the index is not a
+ -- literal.
+
+ if Nkind (Index) in N_Has_Entity
+ and then Nkind (Entity (Index)) in N_Entity
+ then
+ Generate_Reference (Entity (Index), Nam, ' ');
+ end if;
+
-- Up to this point the expression could have been the actual in a
-- simple entry call, and be given by a named association.
===================================================================
@@ -0,0 +1,28 @@
+-- { dg-do compile }
+-- { dg-options "-gnatwu" }
+
+with Ada.Numerics.Discrete_Random; use Ada.Numerics;
+
+procedure Entry_Family is
+ protected Family is
+ entry Call (Boolean);
+ end Family;
+
+ protected body Family is
+ entry Call (for P in Boolean) when True is
+ begin
+ null;
+ end Call;
+
+ end Family;
+
+ package Random_Boolean is new Discrete_Random (Result_Subtype => Boolean);
+ use Random_Boolean;
+
+ Boolean_Generator : Generator;
+
+ B : constant Boolean := Random (Boolean_Generator);
+
+begin
+ Family.Call (B);
+end Entry_Family;