diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-17 13:35:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-17 13:35:24 +0000 |
commit | 6df2355fdded4df637f0d57a55ca018a43ffb985 (patch) | |
tree | 60f125e5e7703baae36c11acb219108df711a873 | |
parent | 6ea910dcf0b35cc77cf1d3ce51ef0420daa38420 (diff) | |
download | gcc-6df2355fdded4df637f0d57a55ca018a43ffb985.tar.gz |
2010-06-17 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): The
designated type of the generated pointer is the type of the original
expression, not that of the function call itself, because the return
type may be an untagged derived type and the function may be an
inherited operation.
2010-06-17 Robert Dewar <dewar@adacore.com>
* exp_ch4.adb: Minor reformatting
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160915 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 3 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 9 |
3 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bc5002581c3..9ec46d14200 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2010-06-17 Arnaud Charlet <charlet@adacore.com> + + * gnatvsn.ads: Bump to 4.6 version. + +2010-06-17 Ed Schonberg <schonberg@adacore.com> + + * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): The + designated type of the generated pointer is the type of the original + expression, not that of the function call itself, because the return + type may be an untagged derived type and the function may be an + inherited operation. + +2010-06-17 Robert Dewar <dewar@adacore.com> + + * exp_ch4.adb: Minor reformatting 2010-06-17 Ed Schonberg <schonberg@adacore.com> * sinfo.ads, sinfo.adb (Inherited_Discriminant): New flag on diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 5174be4c7f0..ddc4fc2e261 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -6687,12 +6687,11 @@ package body Exp_Ch4 is if Is_VMS_Operator (Entity (N)) then declare LI : constant Entity_Id := RTE (RE_Unsigned_64); - begin Rewrite (N, Unchecked_Convert_To (Typ, (Make_Op_Not (Loc, - Right_Opnd => Unchecked_Convert_To (LI, Right_Opnd (N)))))); + Right_Opnd => Unchecked_Convert_To (LI, Right_Opnd (N)))))); Analyze_And_Resolve (N, Typ); return; end; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index d1a56e2ebb7..51fe72875e5 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5095,7 +5095,7 @@ package body Exp_Ch6 is Rewrite (Allocator, New_Allocator); -- Create a new access object and initialize it to the result of the - -- new uninitialized allocator. Do not use Allocator as the + -- new uninitialized allocator. Note: we do not use Allocator as the -- Related_Node of Return_Obj_Access in call to Make_Temporary below -- as this would create a sort of infinite "recursion". @@ -5660,7 +5660,10 @@ package body Exp_Ch6 is Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Caller_Object, Is_Access => Pass_Caller_Acc); - -- Create an access type designating the function's result subtype + -- Create an access type designating the function's result subtype. We + -- use the type of the original expression because it may be a call to + -- an inherited operation, which the expansion has replaced with the + -- parent operation that yields the parent type. Ref_Type := Make_Temporary (Loc, 'A'); @@ -5671,7 +5674,7 @@ package body Exp_Ch6 is Make_Access_To_Object_Definition (Loc, All_Present => True, Subtype_Indication => - New_Reference_To (Result_Subt, Loc))); + New_Reference_To (Etype (Function_Call), Loc))); -- The access type and its accompanying object must be inserted after -- the object declaration in the constrained case, so that the function |