3 package Size_Clause3
is
5 -- The record inherits the alignment of Integer, which is 4, so
6 -- the real size is 64 instead of 40.
12 -- That's not OK, the size of a component of type R1 cannot be 40.
14 rr
: R1
; -- size must be 40
17 rr
at 0 range 0 .. 39; -- { dg-error "size of .rr. with aliased or tagged" }
20 -- The record is explicitly given alignment 1 so its real type is 40.
25 for R2
'Alignment use 1;
27 -- That's OK, the size of a component of type R2 can be 40.
29 rr
: R2
; -- size must be 40
32 rr
at 0 range 0 .. 39;
35 -- The record is explicitly given alignment 4 so its real type is 64.
40 for R3
'Alignment use 4;
42 -- That's not OK, the size of a component of type R3 cannot be 40.
44 rr
: R3
; -- size must be 40
47 rr
at 0 range 0 .. 39; -- { dg-error "size of .rr. with aliased or tagged" }