gcc/testsuite/gnat.dg/aggr25.ads
raw| 1 | package Aggr25 is |
| 2 | |
| 3 | type T_A is (A, B , C ,D); |
| 4 | |
| 5 | subtype Has_B_D is T_A with Static_Predicate => Has_B_D in B | D; |
| 6 | |
| 7 | type Obj_T (Kind : T_A) is |
| 8 | record |
| 9 | case Kind is |
| 10 | --OK-- when A | C => null; --OK-- |
| 11 | when Has_B_D => Value : Boolean; |
| 12 | --BAD-- when A | C => null; |
| 13 | when others => null; |
| 14 | end case; |
| 15 | end record; |
| 16 | |
| 17 | type T is access Obj_T; |
| 18 | |
| 19 | Unavailable : constant T := new Obj_T'(Kind => A); |
| 20 | |
| 21 | procedure Foo; |
| 22 | |
| 23 | end Aggr25; |