1-- { dg-do compile } 2-- { dg-options "-g -gnatVa" } 3 4with Unchecked_Conversion; 5 6procedure Unchecked_Convert7 is 7 8 type BPA is array (1 .. 23) of Boolean; 9 pragma Pack (BPA); 10 for BPA'Size use 23; 11 12 subtype Byte is Natural range 0 .. 255; 13 14 type R is 15 record 16 S : Boolean; 17 E : Byte; 18 F : BPA; 19 end record; 20 21 for R use 22 record 23 S at 0 range 0 .. 0; 24 E at 0 range 1 .. 8; 25 F at 0 range 9 .. 31; 26 end record; 27 for R'Size use 32; 28 29 function Conversion 30 is new Unchecked_Conversion (Source => R, Target => Float); 31 32 F : Float := Conversion (R'(False, Byte'Last, (others => False))); 33 34begin 35 null; 36end; 37