diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-01-12 15:51:40 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-15 11:36:42 +0200 |
commit | 0ca7fcf5635bdd363a5a18e7cf5828d87b5aac55 (patch) | |
tree | 24b274b11f3ec00117bfcb1cafed0bd49aef2a6a | |
parent | 1f068a17811a89035e43894686b333e9070f45ef (diff) | |
download | gcc-0ca7fcf5635bdd363a5a18e7cf5828d87b5aac55.zip gcc-0ca7fcf5635bdd363a5a18e7cf5828d87b5aac55.tar.gz gcc-0ca7fcf5635bdd363a5a18e7cf5828d87b5aac55.tar.bz2 |
ada: Fix internal error on instance in package body with -gnatn
This plugs a small loophole in the procedure responsible for attempting to
hide entities that have been previously made public by the semantic analyzer
in package bodies.
gcc/ada/
* sem_ch7.adb (Hide_Public_Entities): Use the same condition for
subprogram bodies without specification as for those with one.
-rw-r--r-- | gcc/ada/sem_ch7.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 7cb7c86..1f1fbd3 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -446,7 +446,11 @@ package body Sem_Ch7 is else Decl_Id := Defining_Entity (Decl); + -- See the N_Subprogram_Declaration case below + if not Set_Referencer_Of_Non_Subprograms + and then (not In_Nested_Instance + or else not Subprogram_Table.Get_First) and then not Subprogram_Table.Get (Decl_Id) then -- We can reset Is_Public right away |