diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
commit | d58952aefb03632bbb5b441d5c0bd330711f0af1 (patch) | |
tree | d046e56bfbd6a40106ae6ab96fafc954f1dfc955 /gcc/ada/sem_disp.adb | |
parent | 648f8fc59b2cc39abd24f4c22388b346cdebcc31 (diff) | |
parent | 50221fae802a10fafe95e61d40504a58da33e98f (diff) | |
download | gcc-d58952aefb03632bbb5b441d5c0bd330711f0af1.tar.gz |
Merge trunk into svelinaro-dev/sve
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r-- | gcc/ada/sem_disp.adb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 974edd35679..4cc41e3acaa 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -404,7 +404,7 @@ package body Sem_Disp is Func : Entity_Id; Subp_Entity : Entity_Id; Indeterm_Ancestor_Call : Boolean := False; - Indeterm_Ctrl_Type : Entity_Id; + Indeterm_Ctrl_Type : Entity_Id := Empty; -- init to avoid warning Static_Tag : Node_Id := Empty; -- If a controlling formal has a statically tagged actual, the tag of @@ -2371,16 +2371,26 @@ package body Sem_Disp is ----------------------------------- function Is_Inherited_Public_Operation (Op : Entity_Id) return Boolean is - Prim : constant Entity_Id := Alias (Op); - Scop : constant Entity_Id := Scope (Prim); Pack_Decl : Node_Id; + Prim : Entity_Id := Op; + Scop : Entity_Id := Prim; begin + -- Locate the ultimate non-hidden alias entity + + while Present (Alias (Prim)) and then not Is_Hidden (Alias (Prim)) loop + pragma Assert (Alias (Prim) /= Prim); + Prim := Alias (Prim); + Scop := Scope (Prim); + end loop; + if Comes_From_Source (Prim) and then Ekind (Scop) = E_Package then Pack_Decl := Unit_Declaration_Node (Scop); - return Nkind (Pack_Decl) = N_Package_Declaration - and then List_Containing (Unit_Declaration_Node (Prim)) = - Visible_Declarations (Specification (Pack_Decl)); + + return + Nkind (Pack_Decl) = N_Package_Declaration + and then List_Containing (Unit_Declaration_Node (Prim)) = + Visible_Declarations (Specification (Pack_Decl)); else return False; |