public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7846] ada: Fix internal error on instance in package body with -gnatn
@ 2023-09-27  8:23 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2023-09-27  8:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:34e4d3b14006c7d3fba3ebfe96d44a5c435326a7

commit r13-7846-g34e4d3b14006c7d3fba3ebfe96d44a5c435326a7
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Jan 12 15:51:40 2023 +0100

    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.

Diff:
---
 gcc/ada/sem_ch7.adb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 7cb7c862d35..1f1fbd3c703 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-27  8:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27  8:23 [gcc r13-7846] ada: Fix internal error on instance in package body with -gnatn Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).