From: Ed Schonberg Date: Fri, 6 Nov 2020 15:21:06 +0000 (-0500) Subject: [Ada] Spurious visibility error in subprogram body in with_clause X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86b747a553784eb0675406c23f4789afe76eadab;p=gcc.git [Ada] Spurious visibility error in subprogram body in with_clause gcc/ada/ * sem_util.adb (Enter_Name): When an inherited operation for a local derived type is hidden by an explicit declaration of a non-overloadable entity in the same scope, make the inherited operation non-visible to prevent its accidental use elsewhere. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 675aeed6b34..e1535e2f540 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -8288,6 +8288,13 @@ package body Sem_Util is else Set_Name_Entity_Id (Chars (E), Homonym (E)); end if; + + -- The inherited operation cannot be retrieved + -- by name, even though it may remain accesssible + -- in some cases involving subprogram bodies without + -- specs appearing in with_clauses.. + + Set_Is_Immediately_Visible (E, False); end if; end;