From 86ec3bfb9fc3729d1e17d750e2d76be03f4f7110 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 7 Jul 2016 15:20:30 +0200 Subject: [multiple changes] 2016-07-07 Ed Schonberg * 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 * 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 * adaint.c: Complete previous change. From-SVN: r238117 --- gcc/ada/sem_ch4.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_ch4.adb') 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 -- cgit v1.1