[Ada] Spurious error when instance of generic is used as formal package
This patch removes a spurious bug on the use of the current instance of
a generic package G as the actual in a nested instantiation of a generic
unit GU that has a formal package whose generic_package name is G. This
is only legal if G has no generic formal part, and the formal package
declaration is declared with a box or without a formal_paxkage_actual
part.
2019-07-09 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch12.adb (Instantiate_Formal_Package): Handle properly the
case where the actual for a formal package in an instance is the
current instance of an enclosing generic package.
(Check_Formal_Packages): If the formal package declaration is
box-initialized or lacks associations altogether, no internal
instance was created to verify conformance, and there is no
validating package to remove from tree.
gcc/testsuite/
* gnat.dg/generic_inst5.adb, gnat.dg/generic_inst6.adb,
gnat.dg/generic_inst6_g1-c.adb, gnat.dg/generic_inst6_g1-c.ads,
gnat.dg/generic_inst6_g1.ads, gnat.dg/generic_inst6_i1.ads,
gnat.dg/generic_inst6_i2.ads, gnat.dg/generic_inst6_x.ads: New
testcases.
From-SVN: r273275