+2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Apply special treatment
+ of derived packed array types to constrained subtypes only.
+
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Remove
if (Is_Derived_Type (gnat_entity) && !type_annotate_only)
{
Entity_Id gnat_parent_type = Underlying_Type (Etype (gnat_entity));
- /* For packed array subtypes, the implementation type is used. */
+ /* For constrained packed array subtypes, the implementation type is
+ used instead of the nominal type. */
if (kind == E_Array_Subtype
+ && Is_Constrained (gnat_entity)
&& Present (Packed_Array_Impl_Type (gnat_parent_type)))
gnat_parent_type = Packed_Array_Impl_Type (gnat_parent_type);
relate_alias_sets (gnu_type, gnat_to_gnu_type (gnat_parent_type),
+2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/pack10.ads: New test.
+ * gnat.dg/specs/pack10_pkg.ad[sb]: New helper.
+
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/entry_queues2.adb: New test.
--- /dev/null
+-- { dg-do compile }
+
+with Pack10_Pkg; use Pack10_Pkg;
+
+package Pack10 is
+
+ type Boolean_Vector is array (Positive range <>) of Boolean;
+
+ type Packed_Boolean_Vector is new Boolean_Vector;
+ pragma Pack (Packed_Boolean_Vector);
+
+ procedure My_Proc is new Proc (Packed_Boolean_Vector);
+
+end Pack10;
--- /dev/null
+package body Pack10_Pkg is
+
+ procedure Proc is begin null; end;
+
+end Pack10_Pkg;
--- /dev/null
+-- { dg-excess-errors "cannot generate code" }
+
+package Pack10_Pkg is
+
+ generic
+ type Vector_Type (<>) is private;
+ procedure Proc;
+
+end Pack10_Pkg;