| 1 |
-- { dg-do compile } |
| 2 |
|
| 3 |
package body Discr27 is |
| 4 |
|
| 5 |
subtype Index is Positive range 1..4096; |
| 6 |
|
| 7 |
function F return String is |
| 8 |
S : String(1..1) := (others =>'w'); |
| 9 |
begin |
| 10 |
return S; |
| 11 |
end; |
| 12 |
|
| 13 |
type Enum is (One, Two); |
| 14 |
|
| 15 |
type Rec (D : Enum := One; Len : Index := 1) is record |
| 16 |
case D is |
| 17 |
when One => I : Integer; |
| 18 |
when Two => A : String(1..Len); |
| 19 |
end case; |
| 20 |
end record; |
| 21 |
|
| 22 |
procedure Nothing is |
| 23 |
M : constant String := F; |
| 24 |
C : constant Rec := (Two, M'Length, M); |
| 25 |
begin |
| 26 |
null; |
| 27 |
end; |
| 28 |
|
| 29 |
procedure Proc is begin |
| 30 |
null; |
| 31 |
end; |
| 32 |
|
| 33 |
end Discr27; |