Commit 52739835 by Javier Miranda Committed by Arnaud Charlet

exp_aggr.adb (Build_Record_Aggr_Code): Default-initialialized records with IP…

exp_aggr.adb (Build_Record_Aggr_Code): Default-initialialized records with IP subprogram were only supported if...

2005-12-05  Javier Miranda  <miranda@adacore.com>

	* exp_aggr.adb (Build_Record_Aggr_Code): Default-initialialized records
	with IP subprogram were only supported if there were limited types.

	* sem_aggr.adb (Resolve_Record_Aggregate): Default-initialialized
	records with IP subprogram were only supported if there were limited
	types.

From-SVN: r108289
parent 23d0d17f
...@@ -2358,10 +2358,11 @@ package body Exp_Aggr is ...@@ -2358,10 +2358,11 @@ package body Exp_Aggr is
while Present (Comp) loop while Present (Comp) loop
Selector := Entity (First (Choices (Comp))); Selector := Entity (First (Choices (Comp)));
-- Ada 2005 (AI-287): Default initialization of a limited component -- Ada 2005 (AI-287): For each default-initialized component genarate
-- a call to the corresponding IP subprogram if available.
if Box_Present (Comp) if Box_Present (Comp)
and then Is_Limited_Type (Etype (Selector)) and then Has_Non_Null_Base_Init_Proc (Etype (Selector))
then then
-- Ada 2005 (AI-287): If the component type has tasks then -- Ada 2005 (AI-287): If the component type has tasks then
-- generate the activation chain and master entities (except -- generate the activation chain and master entities (except
......
...@@ -29,6 +29,7 @@ with Checks; use Checks; ...@@ -29,6 +29,7 @@ with Checks; use Checks;
with Einfo; use Einfo; with Einfo; use Einfo;
with Elists; use Elists; with Elists; use Elists;
with Errout; use Errout; with Errout; use Errout;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util; with Exp_Util; use Exp_Util;
with Freeze; use Freeze; with Freeze; use Freeze;
with Itypes; use Itypes; with Itypes; use Itypes;
...@@ -2984,11 +2985,15 @@ package body Sem_Aggr is ...@@ -2984,11 +2985,15 @@ package body Sem_Aggr is
Component := Node (Component_Elmt); Component := Node (Component_Elmt);
Expr := Get_Value (Component, Component_Associations (N), True); Expr := Get_Value (Component, Component_Associations (N), True);
-- Ada 2005 (AI-287): Default initialized limited component are -- Ada 2005 (AI-287): Although the default initialization by means
-- passed to the expander, that will generate calls to the -- of the mbox was initially added to Ada 2005 for limited types, it
-- corresponding IP. -- is not constrained to limited types. Therefore if the component
-- has some initialization procedure (IP) we pass the component to
-- the expander, which will generate the call to such IP.
if Mbox_Present and then Is_Limited_Type (Etype (Component)) then if Mbox_Present
and then Has_Non_Null_Base_Init_Proc (Etype (Component))
then
Add_Association Add_Association
(Component => Component, (Component => Component,
Expr => Empty, Expr => Empty,
......
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