[Ada] Spurious constraint error on conversion of access types

Pierre-Marie de Rodat derodat@adacore.com
Thu May 6 07:58:12 GMT 2021


This patch fixes an error in the compiler whereby a spurious constraint
error is raised at runtime on type conversions between
access-to-discriminanted types when the object being converted is null.

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

gcc/ada/

	* checks.adb (Make_Discriminant_Constraint_Check): Add check for
	null when the type being converted is an access type.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 962 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210506/12213d9b/attachment-0001.bin>


More information about the Gcc-patches mailing list