diff options
author | Ed Schonberg <schonberg@adacore.com> | 2020-11-06 10:21:06 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-30 09:16:15 -0500 |
commit | 86b747a553784eb0675406c23f4789afe76eadab (patch) | |
tree | 460fcba53f3a1dfc6b8d2231127b19b4829574e5 /gcc | |
parent | ebbe3f29518854c36574adbd4fa82fd56fa64056 (diff) | |
download | gcc-86b747a553784eb0675406c23f4789afe76eadab.zip gcc-86b747a553784eb0675406c23f4789afe76eadab.tar.gz gcc-86b747a553784eb0675406c23f4789afe76eadab.tar.bz2 |
[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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_util.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 675aeed..e1535e2 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; |