diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-02 09:23:01 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-02 09:23:01 +0000 |
commit | 849f127a29dd219756612d3fd807328c633be2e7 (patch) | |
tree | 9c441de71e752a3df9cf6bc42e11a24f3e70edda /gcc/ada/exp_ch7.adb | |
parent | 98564bfcd46b25d87fdcdcf0c2b247e81f1b825a (diff) | |
download | gcc-849f127a29dd219756612d3fd807328c633be2e7.tar.gz |
2012-04-02 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Process_Declarations): Detect a case where
a source object was initialized by another source object,
but the expression was rewritten as a class-wide conversion
of Ada.Tags.Displace.
* exp_util.adb (Initialized_By_Ctrl_Function): Removed.
(Is_Controlled_Function_Call): New routine.
(Is_Displacement_Of_Ctrl_Function_Result): Removed.
(Is_Displacement_Of_Object_Or_Function_Result): New routine.
(Is_Source_Object): New routine.
(Requires_Cleanup_Actions): Detect a case where a source object was
initialized by another source object, but the expression was rewritten
as a class-wide conversion of Ada.Tags.Displace.
* exp_util.ads (Is_Displacement_Of_Ctrl_Function_Result): Removed.
(Is_Displacement_Of_Object_Or_Function_Result): New routine.
2012-04-02 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Call): A call to an expression function
does not freeze if it appears in a different scope from the
expression function itself. Such calls appear in the generated
bodies of other expression functions, or in pre/postconditions
of subsequent subprograms.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186071 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r-- | gcc/ada/exp_ch7.adb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 525bae71e44..f8730f3d9ab 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1917,16 +1917,17 @@ package body Exp_Ch7 is Processing_Actions (Has_No_Init => True); -- Detect a case where a source object has been initialized by - -- a controlled function call which was later rewritten as a - -- class-wide conversion of Ada.Tags.Displace. + -- a controlled function call or another object which was later + -- rewritten as a class-wide conversion of Ada.Tags.Displace. - -- Obj : Class_Wide_Type := Function_Call (...); + -- Obj1 : CW_Type := Src_Obj; + -- Obj2 : CW_Type := Function_Call (...); - -- Temp : ... := Function_Call (...)'reference; - -- Obj : Class_Wide_Type renames - -- (... Ada.Tags.Displace (Temp)); + -- Obj1 : CW_Type renames (... Ada.Tags.Displace (Src_Obj)); + -- Tmp : ... := Function_Call (...)'reference; + -- Obj2 : CW_Type renames (... Ada.Tags.Displace (Tmp)); - elsif Is_Displacement_Of_Ctrl_Function_Result (Obj_Id) then + elsif Is_Displacement_Of_Object_Or_Function_Result (Obj_Id) then Processing_Actions (Has_No_Init => True); end if; |