Commit 28450a75 by Ed Schonberg Committed by Arnaud Charlet

sem_ch3.adb (Analyze_Type_Declaration): Create freeze node for access type even if...

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

	* sem_ch3.adb (Analyze_Type_Declaration): Create freeze node for access
	type even if the designated type comes from a limited_with clause, to
	ensure that the symbol for the finalization list of the access type is
	created.

From-SVN: r146081
parent 4ff62609
2009-04-15 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Type_Declaration): Create freeze node for access
type even if the designated type comes from a limited_with clause, to
ensure that the symbol for the finalization list of the access type is
created.
2009-04-10 Robert Dewar <dewar@adacore.com> 2009-04-10 Robert Dewar <dewar@adacore.com>
* sem_warn.ads, sem_warn.adb (Check_Low_Bound_Tested): Catch more cases * sem_warn.ads, sem_warn.adb (Check_Low_Bound_Tested): Catch more cases
...@@ -4002,7 +4002,17 @@ package body Sem_Ch3 is ...@@ -4002,7 +4002,17 @@ package body Sem_Ch3 is
Set_First_Subtype_Link (Freeze_Node (B), T); Set_First_Subtype_Link (Freeze_Node (B), T);
end if; end if;
if not From_With_Type (T) then -- A type that is imported through a limited_with clause cannot
-- generate any code, and thus need not be frozen. However, an
-- access type with an imported designated type needs a finalization
-- list, which may be referenced in some other package that has
-- non-limited visibility on the designated type. Thus we must
-- create the finalization list at the point the access type is
-- frozen, to prevent unsatisfied references at link time.
if not From_With_Type (T)
or else Is_Access_Type (T)
then
Set_Has_Delayed_Freeze (T); Set_Has_Delayed_Freeze (T);
end if; end if;
end; end;
......
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