[Ada] Fix crash on quantified expression in expression function

Pierre-Marie de Rodat derodat@adacore.com
Fri Jul 10 09:44:20 GMT 2020


The problem is that the compiler freezes the iterator type associated
with a given type in the body of an expression function that contains
a quantified expression for this type and happens to be the completion
of a previous declaration.   The reason is that Freeze_Expr_Types does
not see that the iterator type is referenced by the expression.

The patch also changes Write_Field24_Name to also display the field as
the Related_Expression for an E_Loop_Parameter entity.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* einfo.adb (Write_Field24_Name): Handle E_Loop_Parameter.
	* freeze.adb (Freeze_Expr_Types): Freeze the iterator type used as
	Default_Iterator of the name of an N_Iterator_Specification node.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1360 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200710/29cc6da5/attachment-0001.bin>


More information about the Gcc-patches mailing list