[Ada] Spurious error passing access to class-wide interface type

Pierre-Marie de Rodat derodat@adacore.com
Mon Jul 22 14:03:00 GMT 2019


The compiler reports an spurious error when the formal parameter of a
subprogram is an access to a class wide interface type and the actual
parameter is an allocator of an object covering such interface type.

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

2019-07-22  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Actuals): Replace code that displaces the
	pointer to an allocated object to reference its secondary
	dispatch table by a type conversion (which takes care of
	handling all cases).

gcc/testsuite/

	* gnat.dg/class_wide5.adb: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1546 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190722/40df23a0/attachment.bin>


More information about the Gcc-patches mailing list