+2008-02-27 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/34799
+ * sem_ch13.adb (Analyze_Record_Representation_Clause): Check
+ that underlying type is present.
+
2008-02-26 Tom Tromey <tromey@redhat.com>
* misc.c (internal_error_function): Remove test of
-- We are only interested in the case where there is at least one
-- unrepped component, and at least half the components have rep
-- clauses. We figure that if less than half have them, then the
- -- partial rep clause is really intentional.
+ -- partial rep clause is really intentional. If the component
+ -- type has no underlying type set at this point (as for a generic
+ -- formal type), we don't know enough to give a warning on the
+ -- component.
if Num_Unrepped_Components > 0
and then Num_Unrepped_Components < Num_Repped_Components
while Present (Comp) loop
if No (Component_Clause (Comp))
and then Comes_From_Source (Comp)
+ and then Present (Underlying_Type (Etype (Comp)))
and then (Is_Scalar_Type (Underlying_Type (Etype (Comp)))
or else Size_Known_At_Compile_Time
(Underlying_Type (Etype (Comp))))
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatwa" }
+
+package PR34799 is
+ generic
+ type Custom_T is private;
+ package Handler is
+ type Storage_T is record
+ A : Boolean;
+ B : Boolean;
+ C : Custom_T;
+ end record;
+
+ for Storage_T use record
+ A at 0 range 0..0;
+ B at 1 range 0..0;
+ end record;
+ end Handler;
+end PR34799;