aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2023-10-12 15:52:27 -0400
committerMarc Poulhiès <poulhies@adacore.com>2023-11-07 10:15:03 +0100
commit7c09fcfcf2b922905a69ad8ab98609f42095f49a (patch)
treef1911486a16356e176dd9e1ac248d3aefbd247d5
parentfe11fa6bd48a781c6acf0416aff1568e0d66f077 (diff)
downloadgcc-7c09fcfcf2b922905a69ad8ab98609f42095f49a.zip
gcc-7c09fcfcf2b922905a69ad8ab98609f42095f49a.tar.gz
gcc-7c09fcfcf2b922905a69ad8ab98609f42095f49a.tar.bz2
ada: Error in prefix-notation call
The compiler gives a wrong error for a call of the form X.Y(...) when Y is inherited indirectly via an interface. gcc/ada/ * sem_ch4.adb (Is_Private_Overriding): Return True in the case where a primitive operation is publicly inherited but privately overridden.
-rw-r--r--gcc/ada/sem_ch4.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 50ba6c9..2f3dfe7 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -10223,9 +10223,15 @@ package body Sem_Ch4 is
elsif not Comes_From_Source (Visible_Op)
and then Alias (Visible_Op) = Op
- and then not Is_Hidden (Visible_Op)
then
- return True;
+ -- If Visible_Op or what it overrides is not hidden, then we
+ -- have found what we're looking for.
+
+ if not Is_Hidden (Visible_Op)
+ or else not Is_Hidden (Overridden_Operation (Op))
+ then
+ return True;
+ end if;
end if;
Visible_Op := Homonym (Visible_Op);