+2009-04-29 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch7.adb (Build_Final_List): If the designated type is a Taft
+ Amendment type, add the with_clause for Finalization.List_Controller
+ only if the current context is a package body.
+
2009-04-29 Thomas Quinot <quinot@adacore.com>
* sem_ch12.adb: Minor reformatting
if Has_Completion_In_Body (Directly_Designated_Type (Typ))
and then In_Package_Body (Current_Scope)
+ and then Nkind (Unit (Cunit (Current_Sem_Unit))) = N_Package_Body
and then
Nkind (Parent (Declaration_Node (Typ))) = N_Package_Specification
then
-- (see exp_ch3.adb). The reference to RE_List_Controller may have
-- added a with_clause to the current body. Formally the spec needs
-- the with_clause as well, so we add it now, for use by Codepeer.
+ -- We verify that we are within a package body, because this code
+ -- can also be invoked within a package instantiation.
declare
Loc : constant Source_Ptr := Sloc (Typ);