[Ada] Error in instance on incomplete actual passed to formal incomplete type

Pierre-Marie de Rodat derodat@adacore.com
Thu Jun 17 14:33:11 GMT 2021


The compiler wrongly issues an error on a generic instantiation when an
incomplete view of a type that is completed before the instantiation is
given as an actual for a formal incomplete type. We now check whether
the full view of the actual incomplete type is present at that point,
and associate the full view with the actual rather than the incomplete
view.

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

gcc/ada/

	* sem_ch12.adb (Instantiate_Type): If the actual type for an
	incomplete formal type is also incomplete, but has a Full_View,
	use the Full_View of the actual type rather than the incomplete
	view.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1047 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210617/bf72090a/attachment-0001.bin>


More information about the Gcc-patches mailing list