compiler: give error for non-int arguments to make
[official-gcc.git] / gcc / testsuite / gnat.dg / discr20.ads
bloba447b3309c320a7fefac46c0a96ab682333b0973
1 package Discr20 is
3 Size : Integer;
5 type Name is new String (1..Size);
7 type Rec is record
8 It : Name;
9 end record;
11 type Danger is (This, That);
12 type def (X : Danger := This) is record
13 case X is
14 when This => It : Rec;
15 when That => null;
16 end case;
17 end record;
19 type Switch is (On, Off);
20 type Wrapper (Disc : Switch := On) is private;
21 function Get (X : Wrapper) return Def;
23 private
24 type Wrapper (Disc : Switch := On) is record
25 Case Disc is
26 when On => It : Def;
27 when Off => null;
28 end case;
29 end record;
31 end Discr20;