gcc/testsuite/gnat.dg/static_pred1.adb
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | package body Static_Pred1 is |
| 4 | |
| 5 | type Enum_Type is (A, B, C); |
| 6 | |
| 7 | subtype Enum_Subrange is Enum_Type with Static_Predicate => |
| 8 | Enum_Subrange in A | C; |
| 9 | |
| 10 | function "not" (Kind : Enum_Subrange) return Enum_Subrange is |
| 11 | (case Kind is |
| 12 | when A => C, |
| 13 | when C => A); |
| 14 | |
| 15 | procedure Dummy (Value : T) is |
| 16 | IK : Enum_Subrange := not A; |
| 17 | begin |
| 18 | null; |
| 19 | end Dummy; |
| 20 | |
| 21 | end Static_Pred1; |