]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Reject use-clause conflicts in the run-time library
authorBob Duff <duff@adacore.com>
Wed, 17 Jul 2024 23:42:57 +0000 (19:42 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 6 Aug 2024 08:54:30 +0000 (10:54 +0200)
commit070f973cd3b99ed57cd40582fa90eb08dc5f84c4
tree4d1a08b5730f2b8bf339112f6591c983f842bfbe
parent0c56fd6a1fe086e038e61041b82df63e98958e9c
ada: Reject use-clause conflicts in the run-time library

This patch fixes a bug where GNAT would fail to detect certain
errors when compiling the run-time library.  In particular, if
two overloaded homographs are both directly visible, it would
pick one, rather than complaining about the ambiguity.

The problem was that some special-purpose code in Sem_Ch8 was trying
to make a user name take precedence over some run-time library
declaration that (incorrectly) appears to be visible because of
rtsfind. The solution is to disable that code while compiling
the run-time library itself.

In addition, we fix the newly-found errors in the run-time library.

gcc/ada/

* sem_ch8.adb (Find_Direct_Name): Disable the special-purpose code
when we are actually compiling the run-time library itself.
* libgnarl/a-exetim__posix.adb: Fix newly-found use-clause
conflicts.
* libgnat/a-direct.adb: Likewise.
* libgnat/a-nbnbin.adb: Likewise.
* libgnat/a-timoio__128.adb: Likewise.
* libgnat/a-timoio.adb: Likewise.
* libgnat/a-wtmoio__128.adb: Likewise.
* libgnat/a-wtmoio.adb: Likewise.
* libgnat/a-ztmoio__128.adb: Likewise.
* libgnat/a-ztmoio.adb: Likewise.
gcc/ada/libgnarl/a-exetim__posix.adb
gcc/ada/libgnat/a-direct.adb
gcc/ada/libgnat/a-nbnbin.adb
gcc/ada/libgnat/a-timoio.adb
gcc/ada/libgnat/a-timoio__128.adb
gcc/ada/libgnat/a-wtmoio.adb
gcc/ada/libgnat/a-wtmoio__128.adb
gcc/ada/libgnat/a-ztmoio.adb
gcc/ada/libgnat/a-ztmoio__128.adb
gcc/ada/sem_ch8.adb