| 1 |
-- { dg-do compile } |
| 2 |
|
| 3 |
package Empty_Variants is |
| 4 |
|
| 5 |
type Rec (D : Integer := 1) is record |
| 6 |
case D is |
| 7 |
when 1 => |
| 8 |
I : Integer; |
| 9 |
when 2 .. 5 => |
| 10 |
J : Integer; |
| 11 |
K : Integer; |
| 12 |
when 6 => |
| 13 |
null; |
| 14 |
when 7 .. 8 => |
| 15 |
null; |
| 16 |
when others => |
| 17 |
L : Integer; |
| 18 |
M : Integer; |
| 19 |
N : Integer; |
| 20 |
end case; |
| 21 |
end record; |
| 22 |
|
| 23 |
R : Rec; |
| 24 |
|
| 25 |
I : Integer := R.I; -- { dg-warning "\"R\.I\" may be referenced before it has a value" } |
| 26 |
J : Integer := R.J; |
| 27 |
K : Integer := R.K; |
| 28 |
L : Integer := R.L; |
| 29 |
M : Integer := R.L; |
| 30 |
|
| 31 |
end Empty_Variants; |
| 32 |
|