Commit 320fbd1e by Justin Squirek Committed by Pierre-Marie de Rodat

[Ada] Fix for freezing of expression functions

2018-05-25  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
	generate code for 6.5(8-10) so that we don't get an assertion error
	when dealing with an incomplete return type.

From-SVN: r260733
parent 29192f7b
2018-05-25 Justin Squirek <squirek@adacore.com>
* exp_ch6.adb (Expand_Simple_Function_Return): Add guard in check to
generate code for 6.5(8-10) so that we don't get an assertion error
when dealing with an incomplete return type.
2018-05-25 Arnaud Charlet <charlet@adacore.com>
* pprint.adb (Expression_Name): Strip too long expressions to avoid
......
......@@ -6759,7 +6759,13 @@ package body Exp_Ch6 is
-- conversion or a formal parameter, because in that case the tag of
-- the expression might differ from the tag of the specific result type.
if Is_Tagged_Type (Utyp)
-- We must also verify an underlying type exists for the return type in
-- case it is incomplete - in which case is not necessary to generate a
-- check anyway since an incomplete limited tagged return type would
-- qualify as a premature usage.
if Present (Utyp)
and then Is_Tagged_Type (Utyp)
and then not Is_Class_Wide_Type (Utyp)
and then (Nkind_In (Exp, N_Type_Conversion,
N_Unchecked_Type_Conversion)
......
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