aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/interface6.adb
blob: 388b00905995339b3eb5a94e2543be278b938122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--  { dg-do compile }

procedure Interface6 is

     type TI  is interface;
     type TI2 is interface;

     type Rec_Type is tagged null record;

     type Rec_Type1 is new TI
     with
     record
         A : Integer;
     end record;

     type Rec_Type2 is new Rec_Type1 and TI2
     with
     record
         B : Integer;
     end record;

     type Rec_Type12 is new Rec_Type1 and TI and TI2
     with
     record
         C : Integer;
     end record;

     generic
         type T is new Rec_Type1 and TI2 with private;
     procedure Test;

     procedure Test is
     begin
         null;
     end Test;

     procedure Test_Instance1 is new Test (T => Rec_Type);  --  { dg-error "actual must implement all interfaces of formal \"T\"" }
     procedure Test_Instance1 is new Test (T => Rec_Type1);  -- { dg-error "actual \"Rec_Type1\" must implement interface \"TI2\"" }
     -- { dg-error "instantiation abandoned" "" { target *-*-* } 37 }
     procedure Test_Instance2 is new Test (T => Rec_Type2);
     procedure Test_Instance12 is new Test (T => Rec_Type12);

begin
     null;
end Interface6;