[Ada] AI12-0170: Abstract subprogram calls in class-wide precond exprs

Pierre-Marie de Rodat derodat@adacore.com
Mon Oct 19 09:54:22 GMT 2020


As specified in AI12-0170, calls to abstract subprograms within pre-
and postcondition expressions of an abstract subprogram of type T
are allowed in some cases, and references to a formal parameter of
the controlling type are reinterpreted as though they had a (notional)
nonabstract type NT that is a formal derived type whose ancestor type
is T. The compiler was properly allowing such abstract calls, but was
also allowing cases that are still illegal, such as when the abstract
call within the aspect is tag-indeterminate, and such a call is now
properly rejected.

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

gcc/ada/

	* sem_disp.adb (Check_Dispatching_Context): When the enclosing
	subprogram is abstract, bypass early return if the call is
	tag-indeterminate, to continue with the later error checking.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1194 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201019/f56a9960/attachment-0001.bin>


More information about the Gcc-patches mailing list