]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Give error for reference to nonvisible library unit
authorBob Duff <duff@adacore.com>
Wed, 3 Jan 2024 21:32:51 +0000 (16:32 -0500)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 6 May 2024 09:11:31 +0000 (11:11 +0200)
commit9737a48553b7b489bbecb59b6dd9a96ed02bb1f8
treedf00600ea10b4c0d3c2da3f6a6b3e7abca140a08
parent615c33804f6a1d3f6dcc02308f59b24c735881dc
ada: Give error for reference to nonvisible library unit

This patch fixes a bug where the compiler would allow
a name X to refer to a library unit that is not visible.
In particular, this happens when the name X occurs in the
private part of a library package, and the parent of that
package contains an instantiation of a generic package, and the
spec of that generic package has "private with X;",
but there is no "private with X;" or "with X;" that applies
to the place where the name X occurs.

Also misc cleanup.

gcc/ada/

* sem_ch10.adb (Expand_With_Clause): Misc cleanup.
(Install_Private_With_Clauses): Avoid installing a private
with_clause that comes from an instantiated generic
(it is marked as Implicit_With, but doesn't come from a parent
with). Fix typo in comment, and other minor cleanups.
gcc/ada/sem_ch10.adb