aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-07-07 15:20:30 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-07-07 15:20:30 +0200
commit86ec3bfb9fc3729d1e17d750e2d76be03f4f7110 (patch)
tree5f9cb4cf824f99f62768c9f881adcfe0418ff120 /gcc/ada/sem_ch4.adb
parent0640c7d139ea91870c378de96cab14d708517593 (diff)
downloadgcc-86ec3bfb9fc3729d1e17d750e2d76be03f4f7110.zip
gcc-86ec3bfb9fc3729d1e17d750e2d76be03f4f7110.tar.gz
gcc-86ec3bfb9fc3729d1e17d750e2d76be03f4f7110.tar.bz2
[multiple changes]
2016-07-07 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Expand_Internal_Init_Call): Subsidiary procedure to Expand_Protected_ Subprogram_Call, to handle properly a call to a protected function that provides the initialization expression for a private component of the same protected type. * sem_ch9.adb (Analyze_Protected_Definition): Layout must be applied to itypes generated for a private operation of a protected type that has a formal of an anonymous access to subprogram, because these itypes have no freeze nodes and are frozen in place. * sem_ch4.adb (Analyze_Selected_Component): If prefix is a protected type and it is not a current instance, do not examine the first private component of the type. 2016-07-07 Arnaud Charlet <charlet@adacore.com> * exp_imgv.adb, g-dynhta.adb, s-regexp.adb, s-fatgen.adb, s-poosiz.adb: Minor removal of extra whitespace. * einfo.ads: minor removal of repeated "as" in comment 2016-07-07 Vadim Godunko <godunko@adacore.com> * adaint.c: Complete previous change. From-SVN: r238117
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 45ad8d6..5c0f4f6 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4804,8 +4804,14 @@ package body Sem_Ch4 is
In_Scope := In_Open_Scopes (Prefix_Type);
while Present (Comp) loop
+ -- Do not examine private operations of the type if not within
+ -- its scope.
+
if Chars (Comp) = Chars (Sel) then
- if Is_Overloadable (Comp) then
+ if Is_Overloadable (Comp)
+ and then (In_Scope
+ or else Comp /= First_Private_Entity (Type_To_Use))
+ then
Add_One_Interp (Sel, Comp, Etype (Comp));
-- If the prefix is tagged, the correct interpretation may