]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix internal error on instance in package body with -gnatn
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 12 Jan 2023 14:51:40 +0000 (15:51 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 15 May 2023 09:36:42 +0000 (11:36 +0200)
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.

gcc/ada/sem_ch7.adb

index 7cb7c862d35f8feb4777a1b5f7a8942d95f3f921..1f1fbd3c70340c19219a046a69eb80c9a7258d52 100644 (file)
@@ -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