[Ada] Spurious discriminant check on "for of" loop

Pierre-Marie de Rodat derodat@adacore.com
Tue Oct 20 07:23:29 GMT 2020


When using a "for ... of" loop with an element of a record type with
defaulted discriminants, a spurious disciminant check is emitted.

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

gcc/ada/

	* sem_ch8.adb (Check_Constrained_Object): Suppress discriminant
	checks when the type has default discriminants and comes from
	expansion of a "for of" loop.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1926 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201020/a4a60a78/attachment.bin>


More information about the Gcc-patches mailing list