2 -- { dg-options "-O -gnatws" }
4 with Unchecked_Conversion
;
8 procedure Copy
(From
, To
: Rec
) is
9 Len
: constant Natural := From
.A
.all'Length;
10 subtype Fixed_String
is String (1 .. Len
);
11 type Fixed_String_Access
is access Fixed_String
;
12 function To_Fixed
is new
13 Unchecked_Conversion
(Source
=> String_Access
,
14 Target
=> Fixed_String_Access
);
15 S
: Fixed_String_Access
:= To_Fixed
(To
.A
);
17 S
(1 .. Len
) := From
.A
.all;