Commit d6e1090a by Hristian Kirtchev Committed by Arnaud Charlet

exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as returning by reference…

exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as returning by reference not just for subprogram body stubs...

2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
	returning by reference not just for subprogram body stubs,
	but for all subprogram cases.
	* sem_util.adb: Code reformatting.
	(Requires_Transient_Scope): Update the call to Results_Differ.
	(Results_Differ): Update the parameter profile and the associated
	comment on usage.

From-SVN: r244616
parent de01377c
2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
returning by reference not just for subprogram body stubs,
but for all subprogram cases.
* sem_util.adb: Code reformatting.
(Requires_Transient_Scope): Update the call to Results_Differ.
(Results_Differ): Update the parameter profile and the associated
comment on usage.
2017-01-19 Ed Schonberg <schonberg@adacore.com>
* sem_dim.adb (Analyze_Dimension): Analyze object declaration and
......
......@@ -5542,13 +5542,7 @@ package body Exp_Ch6 is
Utyp : constant Entity_Id := Underlying_Type (Typ);
begin
if not Acts_As_Spec (N)
and then Nkind (Parent (Parent (Spec_Id))) /=
N_Subprogram_Body_Stub
then
null;
elsif Is_Limited_View (Typ) then
if Is_Limited_View (Typ) then
Set_Returns_By_Ref (Spec_Id);
elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
......@@ -7306,9 +7300,11 @@ package body Exp_Ch6 is
declare
Typ : constant Entity_Id := Etype (Subp);
Utyp : constant Entity_Id := Underlying_Type (Typ);
begin
if Is_Limited_View (Typ) then
Set_Returns_By_Ref (Subp);
elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Subp);
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment