aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch7.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2009-04-29 09:51:28 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-29 11:51:28 +0200
commit4f87ded359716679d2b3c6225e7569ff4cb4b76f (patch)
treeed6fb6fdf8661961979e0ed959931f4d2d5535b3 /gcc/ada/exp_ch7.adb
parent349ff68f06634c5974db48c37929b53e06f857fd (diff)
downloadgcc-4f87ded359716679d2b3c6225e7569ff4cb4b76f.zip
gcc-4f87ded359716679d2b3c6225e7569ff4cb4b76f.tar.gz
gcc-4f87ded359716679d2b3c6225e7569ff4cb4b76f.tar.bz2
exp_ch7.adb (Build_Final_List): If the designated type is a Taft Amendment type...
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. From-SVN: r146939
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r--gcc/ada/exp_ch7.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 145b55d..03f0909 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -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);