+2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
+ array components specially.
+
+2017-05-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Premature_Usage): If the premature usage of
+ an entity is as the expression in its own object decaration,
+ rewrite the reference as Any_Id to prevent cascaded errors or
+ compiler loops when such an entity is used in an address clause.
+
2017-05-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (components_to_record): Add missing guard.
-- Component SSO differs from enclosing composite:
- -- Reject if component is a bit-packed array, as it is represented
- -- as a scalar internally.
-
- if Is_Bit_Packed_Array (Comp_Base) then
- Error_Msg_N
- ("type of packed component must have same scalar storage "
- & "order as enclosing composite", Err_Node);
-
-- Reject if composite is a bit-packed array, as it is rewritten
-- into an array of scalars.
- elsif Is_Bit_Packed_Array (Encl_Base) then
+ if Is_Bit_Packed_Array (Encl_Base) then
Error_Msg_N
("type of packed array must have same scalar storage order "
& "as component", Err_Node);
else
Error_Msg_N
("object& cannot be used before end of its declaration!", N);
+
+ -- If the premature reference appears as the expression in its own
+ -- declaration, rewrite it to prevent compiler loops in subsequent
+ -- uses of this mangled declaration in address clauses.
+
+ if Nkind (Parent (N)) = N_Object_Declaration then
+ Set_Entity (N, Any_Id);
+ end if;
end if;
end Premature_Usage;