-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with Opt; use Opt;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
+with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
end if;
end Is_All_Remote_Call;
+ ---------------------------------
+ -- Is_RACW_Stub_Type_Operation --
+ ---------------------------------
+
+ function Is_RACW_Stub_Type_Operation (Op : Entity_Id) return Boolean is
+ Dispatching_Type : Entity_Id;
+
+ begin
+ case Ekind (Op) is
+ when E_Function | E_Procedure =>
+ Dispatching_Type := Find_Dispatching_Type (Op);
+ return Present (Dispatching_Type)
+ and then Is_RACW_Stub_Type (Dispatching_Type)
+ and then not Is_Internal (Op);
+
+ when others =>
+ return False;
+ end case;
+ end Is_RACW_Stub_Type_Operation;
+
------------------------------------
-- Package_Specification_Of_Scope --
------------------------------------
function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id is
N : Node_Id := Parent (E);
+
begin
while Nkind (N) /= N_Package_Specification loop
N := Parent (N);
with Sem_Ch8; use Sem_Ch8;
with Sem_Ch12; use Sem_Ch12;
with Sem_Disp; use Sem_Disp;
+with Sem_Dist; use Sem_Dist;
with Sem_Util; use Sem_Util;
with Stand; use Stand;
with Sinfo; use Sinfo;
return;
end if;
- -- In an instance, an abstract non-dispatching operation cannot
- -- be a candidate interpretation, because it could not have been
- -- one in the generic (it may be a spurious overloading in the
- -- instance).
+ -- In an instance, an abstract non-dispatching operation cannot be a
+ -- candidate interpretation, because it could not have been one in the
+ -- generic (it may be a spurious overloading in the instance).
elsif In_Instance
and then Is_Overloadable (E)
then
return;
- -- An inherited interface operation that is implemented by some
- -- derived type does not participate in overload resolution, only
- -- the implementation operation does.
+ -- An inherited interface operation that is implemented by some derived
+ -- type does not participate in overload resolution, only the
+ -- implementation operation does.
elsif Is_Hidden (E)
and then Is_Subprogram (E)
end if;
return;
+
+ -- Calling stubs for an RACW operation never participate in resolution,
+ -- they are executed only through dispatching calls.
+
+ elsif Is_RACW_Stub_Type_Operation (E) then
+ return;
end if;
-- If this is the first interpretation of N, N has type Any_Type.
if All_Interp.Last = First_Interp + 1 then
- -- The original interpretation is in fact not overloaded
+ -- The final interpretation is in fact not overloaded. Note that the
+ -- unique legal interpretation may or may not be the original one,
+ -- so we need to update N's entity and etype now, because once N
+ -- is marked as not overloaded it is also expected to carry the
+ -- proper interpretation.
Set_Is_Overloaded (N, False);
+ Set_Entity (N, All_Interp.Table (First_Interp).Nam);
+ Set_Etype (N, All_Interp.Table (First_Interp).Typ);
end if;
end Collect_Interps;