]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2009-04-29 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 09:51:28 +0000 (09:51 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 09:51:28 +0000 (09:51 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146939 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch7.adb

index 43a1075c6562e40eb7742d1c2f4714b17cd8cc50..3b40ca63a4ae629381e8a0bec8f3a8fe4d34cb44 100644 (file)
@@ -1,3 +1,9 @@
+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
index 145b55dec722faa8c38b49f9da0d124831a8330e..03f0909e7cb16268edd16a6d79083a316b30f8a9 100644 (file)
@@ -444,6 +444,7 @@ package body Exp_Ch7 is
 
       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
@@ -454,6 +455,8 @@ package body Exp_Ch7 is
          --  (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);