if (uint_size == No_Uint)
return;
- /* Only issue an error if a Value_Size clause was explicitly given.
- Otherwise, we'd be duplicating an error on the Size clause. */
+ /* Only issue an error if a Value_Size clause was explicitly given for the
+ entity; otherwise, we'd be duplicating an error on the Size clause. */
gnat_attr_node
= Get_Attribute_Definition_Clause (gnat_entity, Attr_Value_Size);
+ if (Present (gnat_attr_node) && Entity (gnat_attr_node) != gnat_entity)
+ gnat_attr_node = Empty;
/* Get the size as an INTEGER_CST. Issue an error if a size was specified
but cannot be represented in bitsizetype. */
--- /dev/null
+-- { dg-do compile }
+
+package Size_Clause5 is
+
+ type Arr is array (1 .. 16) of Boolean;
+
+ type RRec (D : Boolean) is record
+ case D is
+ when True => I : Integer;
+ when False => A : Arr;
+ end case;
+ end record;
+ for RRec'Object_Size use 160;
+ for RRec'Value_Size use 160;
+
+end Size_Clause5;