and then Nkind (Gen_Id) = N_Expanded_Name
then
Par_Ent := Entity (Prefix (Gen_Id));
- Par_Vis := Is_Immediately_Visible (Par_Ent);
- Install_Parent (Par_Ent, In_Body => True);
- Par_Installed := True;
elsif Ekind (Scope (Gen_Unit)) = E_Generic_Package
and then Ekind (Scope (Act_Decl_Id)) = E_Package
Par_Ent := Entity
(Prefix (Name (Get_Unit_Instantiation_Node
(Scope (Act_Decl_Id)))));
- Par_Vis := Is_Immediately_Visible (Par_Ent);
- Install_Parent (Par_Ent, In_Body => True);
- Par_Installed := True;
elsif Is_Child_Unit (Gen_Unit) then
Par_Ent := Scope (Gen_Unit);
+ end if;
+
+ if Present (Par_Ent) then
Par_Vis := Is_Immediately_Visible (Par_Ent);
Install_Parent (Par_Ent, In_Body => True);
Par_Installed := True;
and then Nkind (Gen_Id) = N_Expanded_Name
then
Par_Ent := Entity (Prefix (Gen_Id));
- Par_Vis := Is_Immediately_Visible (Par_Ent);
- Install_Parent (Par_Ent, In_Body => True);
- Par_Installed := True;
-
elsif Is_Child_Unit (Gen_Unit) then
Par_Ent := Scope (Gen_Unit);
+ end if;
+
+ if Present (Par_Ent) then
Par_Vis := Is_Immediately_Visible (Par_Ent);
Install_Parent (Par_Ent, In_Body => True);
Par_Installed := True;