Commit 7d92172c by Bob Duff Committed by Pierre-Marie de Rodat

exp_ch6.adb (Is_Build_In_Place_Result_Type): Fix silly bug -- "Typ" should be "T".

2017-10-19  Bob Duff  <duff@adacore.com>

	* exp_ch6.adb (Is_Build_In_Place_Result_Type): Fix silly bug -- "Typ"
	should be "T".  Handle case of a subtype of a class-wide type.

From-SVN: r253916
parent fb9dd1c7
2017-10-19 Bob Duff <duff@adacore.com> 2017-10-19 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Is_Build_In_Place_Result_Type): Fix silly bug -- "Typ"
should be "T". Handle case of a subtype of a class-wide type.
2017-10-19 Bob Duff <duff@adacore.com>
* exp_util.adb: (Process_Statements_For_Controlled_Objects): Clarify * exp_util.adb: (Process_Statements_For_Controlled_Objects): Clarify
which node kinds can legitimately be ignored, and raise Program_Error which node kinds can legitimately be ignored, and raise Program_Error
for others. for others.
......
...@@ -7249,26 +7249,28 @@ package body Exp_Ch6 is ...@@ -7249,26 +7249,28 @@ package body Exp_Ch6 is
begin begin
-- For T'Class, return True if it's True for T. This is necessary -- For T'Class, return True if it's True for T. This is necessary
-- because a class-wide function might say "return F (...)", where -- because a class-wide function might say "return F (...)", where
-- F returns the corresponding specific type. -- F returns the corresponding specific type. We need a loop in
-- case T is a subtype of a class-wide type.
if Is_Class_Wide_Type (Typ) then while Is_Class_Wide_Type (T) loop
T := Etype (Typ); T := Etype (T);
end if; end loop;
-- If this is a generic formal type in an instance, return True if -- If this is a generic formal type in an instance, return True if
-- it's True for the generic actual type. -- it's True for the generic actual type.
if Nkind (Parent (Typ)) = N_Subtype_Declaration if Nkind (Parent (T)) = N_Subtype_Declaration
and then Present (Generic_Parent_Type (Parent (Typ))) and then Present (Generic_Parent_Type (Parent (T)))
then then
T := Entity (Subtype_Indication (Parent (Typ))); T := Entity (Subtype_Indication (Parent (T)));
if Present (Full_View (T)) then if Present (Full_View (T)) then
T := Full_View (T); T := Full_View (T);
end if; end if;
end if;
elsif Present (Underlying_Type (Typ)) then if Present (Underlying_Type (T)) then
T := Underlying_Type (Typ); T := Underlying_Type (T);
end if; end if;
declare declare
......
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