Fix internal error on function call returning extension of limited interface
[official-gcc.git] / gcc / testsuite / gnat.dg / tagged4.adb
blob7611b9e9d13767d2d4ca7800f448bf937348593d
1 -- { dg-do compile }
3 procedure Tagged4 is
4 type T0 is tagged null record;
6 generic
7 type F1 is tagged private;
8 procedure Gen1;
10 procedure Gen1 is
11 type Inst1 is new F1 with null record; -- { dg-error "ancestor type \"F1\" is formal type of enclosing generic unit \\(RM 3\\.9\\.1 \\(4\\/2\\)\\)" }
12 begin
13 null;
14 end Gen1;
16 generic
17 type F2 is interface;
18 procedure Gen2;
20 procedure Gen2 is
21 type Inst2 is new T0 and F2 with null record; -- { dg-error "ancestor type \"F2\" is formal type of enclosing generic unit \\(RM 3\\.9\\.1 \\(4\\/2\\)\\)" }
22 begin
23 null;
24 end Gen2;
26 begin
27 null;
28 end Tagged4;