[Ada] Legality rule on ancestors of type extensions in generic bodies
authorEd Schonberg <schonberg@adacore.com>
Tue, 13 Aug 2019 08:08:40 +0000 (08:08 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 13 Aug 2019 08:08:40 +0000 (08:08 +0000)
commitcffb8f959c237b5af9e94ad4d0188a34acf5d910
tree18bb05f70bc117e2914071be092fac67bcf7aef9
parent7f078d5b3e3ae2cdf527e6a163edd73238726a80
[Ada] Legality rule on ancestors of type extensions in generic bodies

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.

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.

From-SVN: r274358
gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/tagged4.adb [new file with mode: 0644]