[Ada] Fix resolution of subtype_indication in delta aggregates

Pierre-Marie de Rodat derodat@adacore.com
Tue Nov 24 10:17:01 GMT 2020


For a Subtype_Indication in ordinary array aggregates we explicitly call
Resolve_Discrete_Subtype_Indication; for a Subtype_Indication in delta
array aggregates we implicitly call Sem_Ch3.Analyze_Subtype_Indication,
which is only meant to be used in declarations, not in expressions.

This subtle difference causes a crash in GNATprove mode when delta
aggregate appears inside a body that is inlined-for-proof (which
involves an unusual combination of flags Expander_Active, Full_Analysis
and GNATprove_Mode).

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

gcc/ada/

	* sem_aggr.adb (Resolve_Delta_Array_Aggregate): If the choice is
	a subtype_indication then call
	Resolve_Discrete_Subtype_Indication; both for choices
	immediately inside array delta aggregates and inside
	iterated_component_association within array delta aggregates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2282 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201124/c87679f3/attachment-0001.bin>


More information about the Gcc-patches mailing list