aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/aggr25.ads
blob: 5637cfeec365eafa630bfe435fb59f2fe156fe7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package Aggr25 is

  type T_A is (A, B , C ,D);

  subtype Has_B_D is T_A with Static_Predicate => Has_B_D in B | D;

  type Obj_T (Kind : T_A) is
    record
       case Kind is
        --OK-- when A | C => null; --OK--
        when Has_B_D  =>  Value : Boolean;
        --BAD-- when A | C => null;
        when others => null;
      end case;
    end record;

  type T is access Obj_T;

  Unavailable : constant T := new Obj_T'(Kind => A);

  procedure Foo;

end Aggr25;