1--  { dg-do compile }
2procedure Limited4 is
3    TBD_Error : exception;
4
5    type Lim_Rec is limited record
6        A : Integer;
7        B : Boolean;
8    end record;
9
10    type Lim_Tagged is tagged limited record
11        R : Lim_Rec;
12        N : Natural;
13    end record;
14
15    type Lim_Ext is new Lim_Tagged with record
16       G : Natural;
17    end record;
18
19    --  a) initialization expression of a CW object_declaration
20
21    Obj1 : Lim_Tagged'Class := (raise TBD_Error);
22    Obj2 : Lim_Tagged'Class := Lim_Tagged'Class'(raise TBD_Error);
23
24    --  b) initialization expression of a CW component_declaration
25
26    type Rec is record
27       Comp01 : Lim_Tagged'Class := (raise TBD_Error);
28       Comp02 : Lim_Tagged'Class := Lim_Tagged'Class'((raise TBD_Error));
29    end record;
30
31    --  c) the expression of a record_component_association
32
33    Obj : Lim_Tagged := (R => raise TBD_Error, N => 4);
34
35    --  d) the expression for an ancestor_part of an extension_aggregate
36
37    Ext1 : Lim_Ext := ((raise TBD_Error) with G => 0);
38    Ext2 : Lim_Ext := (Lim_Tagged'(raise TBD_Error) with G => 0);
39
40    --  e) default_expression or actual parameter for a formal object of
41    --     mode in
42
43    function Do_Test1 (Obj : Lim_Tagged) return Boolean is
44    begin
45       return True;
46    end;
47
48    function Do_Test2
49      (Obj : Lim_Tagged := (raise TBD_Error)) return Boolean is
50    begin
51       return True;
52    end;
53
54    Check : Boolean;
55begin
56    Check := Do_Test1 (raise TBD_Error);
57    Check := Do_Test2;
58end;