sem_util.adb (Gather_Components): When gathering components of a nested variant...

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.

From-SVN: r228865
This commit is contained in:
Ed Schonberg 2015-10-16 10:28:37 +00:00 committed by Arnaud Charlet
parent 74e3c26262
commit 251b6a477e
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,9 @@
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,

View file

@ -7292,10 +7292,11 @@ package body Sem_Util is
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;
------------------------
@ -16998,7 +16999,7 @@ package body Sem_Util is
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;
@ -17104,9 +17105,9 @@ package body Sem_Util is
-- 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));