aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/expr_func9.adb
blob: 4bfa21dc647eb37eecf035fff0e99e1c65d8795c (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
--  { dg-do compile }
--  { dg-options "-gnatws" }

procedure Expr_Func9 is

   type Root is interface;

   type Child1 is new Root with null record;

   type Child2 is new Root with record
      I2 : Integer;
   end record;

   function Create (I : Integer) return Child2 is (I2 => I);

   I : Root'Class :=
         (if False
          then Child1'(null record)
          else
           Create (1));

begin
   null;
end Expr_Func9;