summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:16:47 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:16:47 +0000
commit7189ac3e1497d34e2e380ff61ced2efc82540eef (patch)
tree941058b1ecd95e4802adf04bc8d602f2590e2012
parentefbf6c3e49b42e83b5b1a9775451d6b0feea990e (diff)
downloadppe42-gcc-7189ac3e1497d34e2e380ff61ced2efc82540eef.tar.gz
ppe42-gcc-7189ac3e1497d34e2e380ff61ced2efc82540eef.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108289 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/exp_aggr.adb5
-rw-r--r--gcc/ada/sem_aggr.adb13
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 6699b422c24..9c9508fa5cc 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -2358,10 +2358,11 @@ package body Exp_Aggr is
while Present (Comp) loop
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)
- and then Is_Limited_Type (Etype (Selector))
+ and then Has_Non_Null_Base_Init_Proc (Etype (Selector))
then
-- Ada 2005 (AI-287): If the component type has tasks then
-- generate the activation chain and master entities (except
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index b67a6a85fcb..8890ffc43dc 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -29,6 +29,7 @@ with Checks; use Checks;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
+with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Itypes; use Itypes;
@@ -2984,11 +2985,15 @@ package body Sem_Aggr is
Component := Node (Component_Elmt);
Expr := Get_Value (Component, Component_Associations (N), True);
- -- Ada 2005 (AI-287): Default initialized limited component are
- -- passed to the expander, that will generate calls to the
- -- corresponding IP.
+ -- Ada 2005 (AI-287): Although the default initialization by means
+ -- of the mbox was initially added to Ada 2005 for limited types, it
+ -- 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
(Component => Component,
Expr => Empty,
OpenPOWER on IntegriCloud