procedure Premature_Usage (N : Node_Id) is
Kind : constant Node_Kind := Nkind (Parent (Entity (N)));
- E : Entity_Id := Entity (N);
begin
- -- Within an instance, the analysis of the actual for a formal object
- -- does not see the name of the object itself. This is significant only
- -- if the object is an aggregate, where its analysis does not do any
- -- name resolution on component associations. (see 4717-008). In such a
- -- case, look for the visible homonym on the chain.
-
- if In_Instance and then Present (Homonym (E)) then
- E := Homonym (E);
- while Present (E) and then not In_Open_Scopes (Scope (E)) loop
- E := Homonym (E);
- end loop;
-
- if Present (E) then
- Set_Entity (N, E);
- Set_Etype (N, Etype (E));
- return;
- end if;
- end if;
-
case Kind is
when N_Component_Declaration =>
Error_Msg_N