1--  { dg-do compile }
2
3procedure aggr7 is
4
5   package P is
6      type T is limited private;
7      type TT is limited private;
8      type TTT is tagged limited private;
9   private
10      type T is limited
11          record
12             Self : access T := T'Unchecked_Access;
13          end record;
14      type TT is tagged limited
15          record
16             Self : access TT := TT'Unchecked_Access;
17          end record;
18      type TTT is tagged limited
19          record
20             Self : access TTT := TTT'Unchecked_Access;
21          end record;
22   end P;
23
24   package body P is
25      X : T := (Self => <>);
26      XX : TT := (Self => <>);
27      XXX : TTT := (Self => <>);
28      Y : T := (others => <>);
29      YY : TT := (others => <>);
30      YYY : TTT := (others => <>);
31   end P;
32begin
33   null;
34end aggr7;
35