[Ada] Legality rule on ancestors of type extensions in generic bodies

Pierre-Marie de Rodat derodat@adacore.com
Tue Aug 13 08:56:00 GMT 2019


This patch adds an RM reference for the rule that in a generic body a
type extension cannot have ancestors that are generic formal types. The
patch also extends the check to interface progenitors that may appear in
a derived type declaration or private extension declaration.

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

2019-08-13  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch3.adb (Check_Generic_Ancestor): New subprogram,
	aubsidiary to Build_Derived_Record_Type. to enforce the rule
	that a type extension declared in a generic body cznnot have an
	ancestor that is a generic formal (RM 3.9.1 (4/2)). The rule
	applies to all ancestors of the type, including interface
	progenitors.

gcc/testsuite/

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


More information about the Gcc-patches mailing list