r260520 - in /trunk/gcc: ada/ChangeLog ada/atre...
pmderodat@gcc.gnu.org
pmderodat@gcc.gnu.org
Tue May 22 13:23:00 GMT 2018
Author: pmderodat
Date: Tue May 22 13:23:46 2018
New Revision: 260520
URL: https://gcc.gnu.org/viewcvs?rev=260520&root=gcc&view=rev
Log:
[Ada] Spurious visibility error in a nested instance with formal package
This patch fixes a spurious visibility error with a nested instance of a
generic unit with a formal package, when the actual for it is a formal
package PA of an enclosing generic, and there are subsequent uses of the
formals of PA in that generic unit.
2018-05-22 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance,
defined on packages that are actuals for formal packages, in order to
set/reset the visibility of the formals of a formal package with given
actuals, when there are subsequent uses of those formals in the
enclosing generic, as required by RN 12.7 (10).
* atree.ads, atree.adb: Add operations for Elist30.
* atree.h: Add Elist30.
* sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals
that are not defaulted and are thus not visible within the current
instance.
(Check_Formal_Packages): Reset visibility of formals of a formal
package that are not defaulted, on exit from current instance.
gcc/testsuite/
* gnat.dg/gen_formal_pkg.adb, gnat.dg/gen_formal_pkg_a.ads,
gnat.dg/gen_formal_pkg_b.ads, gnat.dg/gen_formal_pkg_w.ads: New
testcase.
Added:
trunk/gcc/testsuite/gnat.dg/gen_formal_pkg.adb
trunk/gcc/testsuite/gnat.dg/gen_formal_pkg_a.ads
trunk/gcc/testsuite/gnat.dg/gen_formal_pkg_b.ads
trunk/gcc/testsuite/gnat.dg/gen_formal_pkg_w.ads
Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/atree.adb
trunk/gcc/ada/atree.ads
trunk/gcc/ada/atree.h
trunk/gcc/ada/einfo.adb
trunk/gcc/ada/einfo.ads
trunk/gcc/ada/sem_ch12.adb
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-cvs
mailing list