c++: constrained lambda error-recovery [PR108972]
[official-gcc.git] / gcc / testsuite / gnat.dg / discr4.adb
blob859daaf7fe3b950fe44c2ce46d0cb52a9933a766
1 -- { dg-do run }
2 -- { dg-options "-gnatws" }
4 procedure discr4 is
5 package Pkg is
6 type Rec_Comp (D : access Integer) is record
7 Data : Integer;
8 end record;
9 --
10 type I is interface;
11 procedure Test (Obj : I) is abstract;
13 Num : aliased Integer := 10;
15 type Root (D : access Integer) is tagged record
16 C1 : Rec_Comp (D); -- test
17 end record;
19 type DT is new Root and I with null record;
21 procedure Dummy (Obj : DT);
22 procedure Test (Obj : DT);
23 end;
25 package body Pkg is
26 procedure Dummy (Obj : DT) is
27 begin
28 raise Program_Error;
29 end;
31 procedure Test (Obj : DT) is
32 begin
33 null;
34 end;
35 end;
37 use Pkg;
39 procedure CW_Test (Obj : I'Class) is
40 begin
41 Obj.Test;
42 end;
44 Obj : DT (Num'Access);
45 begin
46 CW_Test (Obj);
47 end;