-- at the ends of certain declaration lists (like visible-part lists),
-- not when this procedure is called at arbitrary freeze points.
- if not Nonoverridable_Only
- and then not Scope_Within_Or_Same (Current_Scope, Scope (E))
- then
+ if not Nonoverridable_Only and then not In_Open_Scopes (Scope (E)) then
if Is_Type (E) and then From_Nested_Package (E) then
declare
Pack : constant Entity_Id := Scope (E);
return
Ekind (Pack) = E_Package
and then not Is_Frozen (Pack)
- and then not Scope_Within_Or_Same (Current_Scope, Pack)
+ and then not In_Open_Scopes (Pack)
and then In_Open_Scopes (Scope (Pack));
end From_Nested_Package;
--- /dev/null
+-- { dg-do link }
+
+with Generic_Inst16_Pkg.Child.Grandchild;
+with Generic_Inst16_Proc;
+
+procedure Generic_Inst16 is
+ package P1 is new Generic_Inst16_Pkg.Child;
+ procedure P2 is new Generic_Inst16_Proc (P1);
+begin
+ null;
+end;
--- /dev/null
+generic
+package Generic_Inst16_Pkg.Child.Grandchild is
+
+ type CT is new GPT with private;
+
+ Zippo_CT1 : constant CT;
+ Zippo_CT2 : constant CT;
+
+private
+
+ type CT is new PT with
+ record
+ Small_Pi : Natural := 314;
+ end record;
+
+ Zippo_CT1 : constant CT := (Zippo_PT with Small_Pi => 0);
+ Zippo_CT2 : constant CT :=
+ (Generic_Inst16_Pkg.Child.Zippo_PT with Small_Pi => 0);
+
+end Generic_Inst16_Pkg.Child.Grandchild;
--- /dev/null
+generic
+package Generic_Inst16_Pkg.Child is
+
+ type PT is new GPT with private;
+
+ Zippo_PT : constant PT;
+
+private
+
+ type PT is new GPT with
+ record
+ Pos_Pi : Natural := 314159265;
+ end record;
+
+ Zippo_PT : constant PT := (Pos_Pi => 0);
+
+end Generic_Inst16_Pkg.Child;
--- /dev/null
+package Generic_Inst16_Pkg is
+
+ type GPT is interface;
+
+end Generic_Inst16_Pkg;
--- /dev/null
+with Generic_Inst16_Pkg.Child.Grandchild;
+
+procedure Generic_Inst16_Proc is
+ package Inst_Grandchild is new Inst_Child.Grandchild;
+begin
+ null;
+end;
--- /dev/null
+with Generic_Inst16_Pkg.Child;
+
+generic
+ with package Inst_Child is new Generic_Inst16_Pkg.Child (<>);
+procedure Generic_Inst16_Proc;