+2015-10-16 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Gather_Components): When gathering components
+ of a nested variant, the record type used in legality checks is
+ the enclosing record type.
+
2015-10-13 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
end if;
-- If we have found the corresponding choice, recursively add its
- -- components to the Into list.
+ -- components to the Into list. The nested components are part of
+ -- the same record type.
Gather_Components
- (Empty, Component_List (Variant), Governed_By, Into, Report_Errors);
+ (Typ, Component_List (Variant), Governed_By, Into, Report_Errors);
end Gather_Components;
------------------------
begin
-- This is a private type which is not completed yet. This can only
-- happen in a default expression (of a formal parameter or of a
- -- record component). Do not expand transient scope in this case
+ -- record component). Do not expand transient scope in this case.
if No (Typ) then
return False;
-- nondiscriminants). That is, the recursive calls are too conservative.
function Has_Discrim_Dep_Array (Typ : Entity_Id) return Boolean;
- -- True if we find certain discriminant-dependent array
- -- subcomponents. This shouldn't be necessary, but without this check,
- -- we crash in gimplify. ???
+ -- True if we find certain discriminant-dependent array subcomponents.
+ -- This shouldn't be necessary, but without this check, we crash in
+ -- gimplify. ???
function Caller_Known_Size_Record (Typ : Entity_Id) return Boolean is
pragma Assert (Typ = Underlying_Type (Typ));