Commit bf06d37f by Arnaud Charlet

[multiple changes]

2009-04-20  Jerome Lambourg  <lambourg@adacore.com>

	* impunit.adb: Add i-cil and i-cilobj packages, now needed by the
	generated bindings for cil.

2009-04-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_aggr.adb (Resolve_Record_Aggregate): If the type has unknown
	discriminants, collect components from the Underlying_Record_View,
	which will be used in the expansion of the aggregate into assignments.

	* sem_ch3.adb: Do not label derived type with unknown discriminants as
	having a private declaration.

From-SVN: r146415
parent 58a9d876
2009-04-20 Jerome Lambourg <lambourg@adacore.com>
* impunit.adb: Add i-cil and i-cilobj packages, now needed by the
generated bindings for cil.
2009-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Record_Aggregate): If the type has unknown
discriminants, collect components from the Underlying_Record_View,
which will be used in the expansion of the aggregate into assignments.
* sem_ch3.adb: Do not label derived type with unknown discriminants as
having a private declaration.
2009-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Expand_Subtype_From_Expr): use the
......@@ -300,6 +300,8 @@ package body Impunit is
------------------------------------------
"i-cexten", -- Interfaces.C.Extensions
"i-cil ", -- Interfaces.CIL
"i-cilobj", -- Interfaces.CIL.Object
"i-cpp ", -- Interfaces.CPP
"i-cstrea", -- Interfaces.C.Streams
"i-java ", -- Interfaces.Java
......
......@@ -3100,11 +3100,22 @@ package body Sem_Aggr is
end if;
end loop;
-- Now collect components from all other ancestors
-- Now collect components from all other ancestors, beginning
-- with the current type. If the type has unknown discriminants
-- use the component list of the underlying_record_view, which
-- needs to be used for the subsequent expansion of the aggregate
-- into assignments.
Parent_Elmt := First_Elmt (Parent_Typ_List);
while Present (Parent_Elmt) loop
Parent_Typ := Node (Parent_Elmt);
if Has_Unknown_Discriminants (Parent_Typ)
and then Present (Underlying_Record_View (Typ))
then
Parent_Typ := Underlying_Record_View (Parent_Typ);
end if;
Record_Def := Type_Definition (Parent (Base_Type (Parent_Typ)));
Gather_Components (Empty,
Component_List (Record_Extension_Part (Record_Def)),
......@@ -3120,12 +3131,21 @@ package body Sem_Aggr is
if Null_Present (Record_Def) then
null;
else
elsif not Has_Unknown_Discriminants (Typ) then
Gather_Components (Base_Type (Typ),
Component_List (Record_Def),
Governed_By => New_Assoc_List,
Into => Components,
Report_Errors => Errors_Found);
else
Gather_Components
(Base_Type (Underlying_Record_View (Typ)),
Component_List (Record_Def),
Governed_By => New_Assoc_List,
Into => Components,
Report_Errors => Errors_Found);
end if;
end if;
......
......@@ -5557,7 +5557,8 @@ package body Sem_Ch3 is
(N, Parent_Type, Derived_Type, Derive_Subps);
-- Build anonymous completion, as a derivation from the full
-- view of the parent.
-- view of the parent. This is not a completion in the usual
-- sense, because the current type is not private.
Decl :=
Make_Full_Type_Declaration (Loc,
......@@ -5569,9 +5570,6 @@ package body Sem_Ch3 is
(Subtype_Indication (Type_Definition (N))),
Record_Extension_Part => New_Ext));
Set_Has_Private_Declaration (Full_Der);
Set_Has_Private_Declaration (Derived_Type);
-- If the parent type has an underlying record view, use it
-- here to build the new underlying record view.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment