the entity as indirect reference to the renamed object. */
if (Materialize_Entity (gnat_entity))
{
+ /* If this is an aliased object with an unconstrained array
+ nominal subtype, we make its type a thin reference, i.e.
+ the reference counterpart of a thin pointer, exactly as
+ we would have done in the non-renaming case below. */
+ if (Is_Constr_Subt_For_UN_Aliased (gnat_type)
+ && Is_Array_Type (gnat_und_type)
+ && !type_annotate_only)
+ {
+ tree gnu_array
+ = gnat_to_gnu_type (Base_Type (gnat_type));
+ gnu_type = TYPE_OBJECT_RECORD_TYPE (gnu_array);
+ }
gnu_type = build_reference_type (gnu_type);
const_flag = true;
volatile_flag = false;