summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch9.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-28 09:25:52 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-28 09:25:52 +0000
commit82ae9906449fcb561e7629d328535d7858ad8638 (patch)
tree409d0b1b799c65c6daebf6bc8a4193dc7ff5485e /gcc/ada/exp_ch9.adb
parentc1476d9e66e82033e06ac796f2c9b2922b80d922 (diff)
downloadgcc-82ae9906449fcb561e7629d328535d7858ad8638.tar.gz
2009-07-28 Emmanuel Briot <briot@adacore.com>
* prj.adb, prj.ads (Compute_All_Imported_Projects): Make sure the importing project does not end up in the list, in the case of extending projects. * make.adb, makeutl.adb, makeutl.ads (File_Not_A_Source_Of): Moved to makeutl.ads, for better sharing with gprbuild. 2009-07-28 Arnaud Charlet <charlet@adacore.com> * gnat_ugn.texi: Fix typo. 2009-07-28 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Build_Derived_Concurrent_Type): Handle properly a derivation that renames some discriminants and constrain others. * exp_ch9.adb (Build_Protected_Subprogram_Call): If the type of the prefix is a derived untagged type, convert to the root type to conform to the signature of the protected operations. 2009-07-28 Robert Dewar <dewar@adacore.com> * sinfo.ads: Update comments. * exp_attr.adb: Minor reformatting git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150152 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch9.adb')
-rw-r--r--gcc/ada/exp_ch9.adb16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index e75ceca4ea5..3a7fa25065d 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -3193,6 +3193,18 @@ package body Exp_Ch9 is
Params := New_List;
end if;
+ -- If the type is an untagged derived type, convert to the root type,
+ -- which is the one on which the operations are defined.
+
+ if Nkind (Rec) = N_Unchecked_Type_Conversion
+ and then not Is_Tagged_Type (Etype (Rec))
+ and then Is_Derived_Type (Etype (Rec))
+ then
+ Set_Etype (Rec, Root_Type (Etype (Rec)));
+ Set_Subtype_Mark (Rec,
+ New_Occurrence_Of (Root_Type (Etype (Rec)), Sloc (N)));
+ end if;
+
Prepend (Rec, Params);
if Ekind (Sub) = E_Procedure then
@@ -4358,8 +4370,8 @@ package body Exp_Ch9 is
return N;
else
return
- Unchecked_Convert_To (Corresponding_Record_Type (Typ),
- New_Copy_Tree (N));
+ Unchecked_Convert_To
+ (Corresponding_Record_Type (Typ), New_Copy_Tree (N));
end if;
end Convert_Concurrent;