summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_intr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-04 13:28:00 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-04 13:28:00 +0000
commit0ffb31d274d4fbe47a3b784a38221e99da3c57db (patch)
tree38e64f2e6dd2f26517d091c0b94c090934e9678b /gcc/ada/exp_intr.adb
parent02fe24464b3abecbd620d02106b9792e634a00e2 (diff)
downloadgcc-0ffb31d274d4fbe47a3b784a38221e99da3c57db.tar.gz
2005-07-04 Ed Schonberg <schonberg@adacore.com>
* exp_intr.adb (Expand_Unc_Deallocation): If the designated type is controlled, indicate the expected type of the dereference that is created for the call to Deep_Finalize, to prevent spurious errors when the designated type is private and completed with a derivation from another private type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_intr.adb')
-rw-r--r--gcc/ada/exp_intr.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index df50c65845f..ea5d74f8b97 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -664,12 +664,21 @@ package body Exp_Intr is
-- If the type is tagged, then we must force dispatching on the
-- finalization call because the designated type may not be the
- -- actual type of the object
+ -- actual type of the object.
if Is_Tagged_Type (Desig_T)
and then not Is_Class_Wide_Type (Desig_T)
then
Deref := Unchecked_Convert_To (Class_Wide_Type (Desig_T), Deref);
+
+ elsif not Is_Tagged_Type (Desig_T) then
+
+ -- Set type of result, to force a conversion when needed (see
+ -- exp_ch7, Convert_View), given that Deep_Finalize may be
+ -- inherited from the parent type, and we need the type of the
+ -- expression to see whether the conversion is in fact needed.
+
+ Set_Etype (Deref, Desig_T);
end if;
Free_Cod :=