[Ada] Fix bogus CE raised on call to overloaded function

Eric Botcazou ebotcazou@adacore.com
Thu Mar 24 15:16:00 GMT 2011


The attached code (derived from ACATS c34006d) raises a bogus Constraint_Error 
since at least GCC 3.4:

raised CONSTRAINT_ERROR : p.adb:33 discriminant check failed

This is related to the overloading of function Create.

Tested on i586-suse-linux, applied on the mainline.


2011-03-24  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (gnat_to_gnu): Remove obsolete case of
	non-conversion to the nominal result type at the end.


2011-03-24  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/derived_type2.adb: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 2158 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110324/340edb78/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: derived_type2.adb
Type: text/x-adasrc
Size: 633 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110324/340edb78/attachment-0001.bin>


More information about the Gcc-patches mailing list