When compiling a descendant instance unit use_clauses in parent units are chained to simplify removal at end of compilation. Use_clauses that appear in the private part of parent are chained when compiling the private part of the descendant. To prevent circularities in the list, use_clauses in the private part of an ancestor should not be chained if there is an intervening parent whose private part is already installed. The following must compile properly: gcc -c -gnatn2 main.adbo --- with P2; with P3; package body Main is package P2_Instance is new P2.Instance (Boolean); end; --- package Main is pragma Elaborate_Body; end; --- package G1 is generic package Instance is end; end; --- generic package G2.Child is end; package body G2 is procedure P is begin null; end; end; --- generic package G2 is procedure P; pragma Inline (P); end; --- with G2.Child; package P1.G2_Instance.Child_Instance is new P1.G2_Instance.Child; --- with G2; package P1.G2_Instance is new G2; --- with G1; package P1 is private package G1_Instance is new G1.Instance; use G1_Instance; end; --- with P1.G2_Instance; package body P2 is package body Instance is procedure R (X : T_Access) is begin null; end; end Instance; end; --- package P2 is generic type T is private; package Instance is type T_Access is access all T; procedure R (X : T_Access); end Instance; end; --- with P1.G2_Instance.Child_Instance; package body P3 is end; --- with S; package P3 is pragma Elaborate_Body; function F (S : Boolean) return Integer is (0); function F (I : Integer) return Integer is (F(S.G(I))); end; --- package S is function G (I : Integer) return Boolean; end; Tested on x86_64-pc-linux-gnu, committed on trunk 2015-03-02 Ed Schonberg * sem_ch8.adb (Chain_Use_Clause): Do not chain use clause from ancestor to list of use clauses active in descendant unit if we are within the private part of an intervening parent, to prevent circularities in use clause list.