gcc/testsuite/gnat.dg/predicate5.ads
raw| 1 | generic |
| 2 | type Value_Type is private; |
| 3 | package Predicate5 is |
| 4 | type MT (Has : Boolean := False) is record |
| 5 | case Has is |
| 6 | when False => |
| 7 | null; |
| 8 | when True => |
| 9 | MX : Value_Type; |
| 10 | end case; |
| 11 | end record; |
| 12 | function Foo (M : MT) return Boolean is (not M.Has); |
| 13 | subtype LT is MT with Dynamic_Predicate => not LT.Has; |
| 14 | function Bar (M : MT) return Boolean is (Foo (M)); |
| 15 | |
| 16 | procedure Foo; |
| 17 | end; |