Set_Etype (N2, E);
end if;
+ -- If the entity is global, save its type in the generic node
+
if Is_Global (E) then
Set_Global_Type (N, N2);
Set_Etype (N, Empty);
end if;
+ -- If default actuals have been added to a generic instantiation
+ -- and they are global, save them in the generic node.
+
if Nkind (Parent (N)) in N_Generic_Instantiation
and then N = Name (Parent (N))
then
Save_Global_Defaults (Parent (N), Parent (N2));
end if;
+ if Nkind (Parent (N)) = N_Selected_Component
+ and then N = Selector_Name (Parent (N))
+ and then Nkind (Parent (Parent (N))) in N_Generic_Instantiation
+ and then Parent (N) = Name (Parent (Parent (N)))
+ then
+ Save_Global_Defaults
+ (Parent (Parent (N)), Parent (Parent (N2)));
+ end if;
+
elsif Nkind (Parent (N)) = N_Selected_Component
and then Nkind (Parent (N2)) = N_Expanded_Name
then
elsif Nkind (N) = N_Pragma then
Save_References_In_Pragma (N);
+ -- Aspects
+
elsif Nkind (N) = N_Aspect_Specification then
declare
P : constant Node_Id := Parent (N);
- Expr : Node_Id;
- begin
+ begin
if Permits_Aspect_Specifications (P) then
-- The capture of global references within aspects
if Requires_Delayed_Save (Original_Node (P)) then
null;
- -- Otherwise save all global references within the
- -- aspects
-
- else
- Expr := Expression (N);
+ -- Otherwise save all global references within the
+ -- expression of the aspect.
- if Present (Expr) then
- Save_Global_References (Expr);
- end if;
+ elsif Present (Expression (N)) then
+ Save_Global_References (Expression (N));
end if;
end if;
end;
elsif Nkind (N) = N_Implicit_Label_Declaration then
null;
+ -- Other nodes
+
else
Save_References_In_Descendants (N);
end if;
-
end Save_References;
---------------------
--- /dev/null
+with Generic_Inst3_Pkg2; use Generic_Inst3_Pkg2;
+with Generic_Inst3_Pkg3, Generic_Inst3_Pkg3.Child;
+
+package body Generic_Inst3_Pkg1 is
+
+ package Pkg3 is new Generic_Inst3_Pkg3 (T);
+
+ use Pkg3;
+
+ package Child is new Pkg3.Child;
+
+ procedure Proc is null;
+
+end Generic_Inst3_Pkg1;