===================================================================
@@ -8740,6 +8740,10 @@
integer field, and so the default size of record objects for this type
will be 64 (8 bytes).
+If the alignment of the above record is specified to be 1, then the
+object size will be 40 (5 bytes). This is true by default, and also
+an object size of 40 can be explicitly specified in this case.
+
A consequence of this capability is that different object sizes can be
given to subtypes that would otherwise be considered in Ada to be
statically matching. But it makes no sense to consider such subtypes
===================================================================
@@ -4413,17 +4413,17 @@
else
Check_Size (Expr, U_Ent, Size, Biased);
- if Size /= 8
- and then
- Size /= 16
- and then
- Size /= 32
- and then
- UI_Mod (Size, 64) /= 0
- then
- Error_Msg_N
- ("Object_Size must be 8, 16, 32, or multiple of 64",
- Expr);
+ if Is_Scalar_Type (U_Ent) then
+ if Size /= 8 and then Size /= 16 and then Size /= 32
+ and then UI_Mod (Size, 64) /= 0
+ then
+ Error_Msg_N
+ ("Object_Size must be 8, 16, 32, or multiple of 64",
+ Expr);
+ end if;
+
+ elsif Size mod 8 /= 0 then
+ Error_Msg_N ("Object_Size must be a multiple of 8", Expr);
end if;
Set_Esize (U_Ent, Size);