diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-31 08:59:01 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-31 08:59:01 +0000 |
commit | 6854063cad4f60406d41d8f5b4fcd60429293baf (patch) | |
tree | ad656d24959df5b9496983f927a2a5e6ba1f20a1 /gcc/ada/sem_ch4.adb | |
parent | 99f61ee1b47f764fc7943c6c2a99becdcc00b787 (diff) | |
download | ppe42-gcc-6854063cad4f60406d41d8f5b4fcd60429293baf.tar.gz ppe42-gcc-6854063cad4f60406d41d8f5b4fcd60429293baf.zip |
2011-08-31 Javier Miranda <miranda@adacore.com>
* sem_ch4.adb (Try_Object_Operation): When a dispatching primitive is
found check if there is a class-wide subprogram covering the primitive.
2011-08-31 Yannick Moy <moy@adacore.com>
* sem_res.adb: Further cases where full expansion test is needed,
rather than expansion test.
2011-08-31 Pascal Obry <obry@adacore.com>
* prj-attr.adb: Fix Source_File_Switches attribute kind (must be a list)
2011-08-31 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb: Handle iterators over derived container types.
2011-08-31 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.ads, einfo.adb: Add new flag Has_Anonymous_Master.
(Has_Anonymous_Master): New routine.
(Set_Has_Anonymous_Master): New routine.
(Write_Entity_Flags): Add an entry for Has_Anonymous_Master.
* exp_ch4.adb: Add with and use clause for Sem_Ch8.
(Current_Anonymous_Master): New routine.
(Current_Unit_First_Declaration): Removed.
(Current_Unit_Scope): Removed.
(Expand_N_Allocator): Anonymous access-to-controlled types now chain
their objects on a per-unit heterogeneous finalization master.
2011-08-31 Matthew Heaney <heaney@adacore.com>
* a-cbhama.adb, a-cbhase.adb (Insert): Check for zero-length buckets
array.
2011-08-31 Jose Ruiz <ruiz@adacore.com>
* s-taprop-linux.adb (Create_Task): Avoid changing the affinity mask
when not needed.
2011-08-31 Gary Dismukes <dismukes@adacore.com>
* sem_disp.adb (Propagate_Tag): Return without propagating in the case
where the actual is an unexpanded call to 'Input.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178361 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r-- | gcc/ada/sem_ch4.adb | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 34df78348c6..2745389599a 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -6638,7 +6638,7 @@ package body Sem_Ch4 is Call : Node_Id; Subp : Entity_Id) return Entity_Id; -- If the subprogram is a valid interpretation, record it, and add - -- to the list of interpretations of Subprog. + -- to the list of interpretations of Subprog. Otherwise return Empty. procedure Complete_Object_Operation (Call_Node : Node_Id; @@ -7104,6 +7104,14 @@ package body Sem_Ch4 is and then N = Name (Parent (N)) then goto Next_Hom; + + -- If the context is a function call, ignore procedures + -- in the name of the call. + + elsif Ekind (Hom) = E_Procedure + and then Nkind (Parent (N)) /= N_Procedure_Call_Statement + then + goto Next_Hom; end if; Set_Etype (Call_Node, Any_Type); @@ -7271,16 +7279,39 @@ package body Sem_Ch4 is return; end if; - if Try_Primitive_Operation - (Call_Node => New_Call_Node, - Node_To_Replace => Node_To_Replace) - or else - Try_Class_Wide_Operation - (Call_Node => New_Call_Node, - Node_To_Replace => Node_To_Replace) - then - null; - end if; + declare + Dup_Call_Node : constant Node_Id := New_Copy (New_Call_Node); + CW_Result : Boolean; + Prim_Result : Boolean; + pragma Unreferenced (CW_Result); + + begin + Prim_Result := + Try_Primitive_Operation + (Call_Node => New_Call_Node, + Node_To_Replace => Node_To_Replace); + + -- Check if there is a class-wide subprogram covering the + -- primitive. This check must be done even if a candidate + -- was found in order to report ambiguous calls. + + if not (Prim_Result) then + CW_Result := + Try_Class_Wide_Operation + (Call_Node => New_Call_Node, + Node_To_Replace => Node_To_Replace); + + -- If we found a primitive we search for class-wide subprograms + -- using a duplicate of the call node (done to avoid missing its + -- decoration if there is no ambiguity). + + else + CW_Result := + Try_Class_Wide_Operation + (Call_Node => Dup_Call_Node, + Node_To_Replace => Node_To_Replace); + end if; + end; end Try_One_Prefix_Interpretation; ----------------------------- |