summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-26 15:50:54 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-26 15:50:54 +0000
commit0d62e683c4db064ac84a8fbb28c0684623b02243 (patch)
tree01fea713d5bd1d17b573ed1dc05f25ee213c31d7 /gcc/ada/exp_ch3.adb
parente837acdfcc08d0b55033040bf805bce03207a83f (diff)
downloadgcc-0d62e683c4db064ac84a8fbb28c0684623b02243.tar.gz
2008-05-26 Gary Dismukes <dismukes@adacore.com>
* exp_ch3.adb (Expand_N_Object_Declaration): Remove checks for No_Default_Initialization, which is now delayed until the freeze point of the object. Add a comment about deferral of the check. * freeze.adb (Freeze_Entity): The check for No_Default_Initialization on objects is moved here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 8324763e92a..71f09e4f3f1 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -4278,7 +4278,11 @@ package body Exp_Ch3 is
and then not Suppress_Init_Proc (Typ)
then
- Check_Restriction (No_Default_Initialization, N);
+ -- Return without initializing when No_Default_Initialization
+ -- applies. Note that the actual restriction check occurs later,
+ -- when the object is frozen, because we don't know yet whether
+ -- the object is imported, which is a case where the check does
+ -- not apply.
if Restriction_Active (No_Default_Initialization) then
return;
@@ -4324,7 +4328,6 @@ package body Exp_Ch3 is
and then not Is_Internal (Def_Id)
and then not Has_Init_Expression (N)
then
- Check_Restriction (No_Default_Initialization, N);
Set_No_Initialization (N, False);
Set_Expression (N, Get_Simple_Init_Val (Typ, N, Esize (Def_Id)));
Analyze_And_Resolve (Expression (N), Typ);