aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
-rw-r--r--gcc/ada/exp_ch13.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 60a11478cb7..4e4ff664847 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -243,6 +243,7 @@ package body Exp_Ch13 is
In_Other_Scope : Boolean;
In_Outer_Scope : Boolean;
Decl : Node_Id;
+ Delete : Boolean := False;
begin
-- For object, with address clause, check alignment is OK
@@ -317,7 +318,7 @@ package body Exp_Ch13 is
-- If type, freeze the type
if Is_Type (E) then
- Freeze_Type (N);
+ Delete := Freeze_Type (N);
-- And for enumeration type, build the enumeration tables
@@ -388,6 +389,12 @@ package body Exp_Ch13 is
end loop;
end if;
+ -- If we are to delete this N_Freeze_Entity, do so by rewriting
+ -- so that a loop on all nodes being inserted will work propertly.
+ if Delete then
+ Rewrite (N, Make_Null_Statement (Sloc (N)));
+ end if;
+
if In_Other_Scope then
if Ekind (Current_Scope) = E_Package then
End_Package_Scope (E_Scope);