E : constant Entity_Id := Defining_Entity_Or_Empty (N);
begin
if Present (E) then
- if Ekind (E) = E_Void
- and then Nkind (N) = N_Component_Declaration
+ if Nkind (N) = N_Component_Declaration
and then Present (Scope (E))
and then Ekind (Scope (E)) = E_Record_Type
then
-- Start of processing for Analyze_Component_Declaration
begin
+ Mutate_Ekind (Id, E_Component);
Generate_Definition (Id);
Enter_Name (Id);
-- Start of processing for Is_Visible_Component
begin
- if Ekind (C) in E_Component | E_Discriminant then
+ if Ekind (C) in E_Component | E_Discriminant
+ and then Is_Not_Self_Hidden (C)
+ then
Original_Comp := Original_Record_Component (C);
end if;
Component := First_Entity (Current_Scope);
while Present (Component) loop
- if Ekind (Component) = E_Void
- and then not Is_Itype (Component)
+ if Ekind (Component) = E_Component and then not Is_Itype (Component)
then
- Mutate_Ekind (Component, E_Component);
Reinit_Component_Location (Component);
Set_Is_Not_Self_Hidden (Component);
end if;