summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_disp.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-15 13:57:17 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-15 13:57:17 +0000
commit57df6d00c860b5214bda34307c9584e37dae076c (patch)
tree4f1dba856298f6524ce033b13b4fe152243e281e /gcc/ada/sem_disp.adb
parent1086fe9f8d36cbe4897ab56aa9de5ac4450e3432 (diff)
downloadgcc-57df6d00c860b5214bda34307c9584e37dae076c.tar.gz
2007-10-15 Ed Schonberg <schonberg@adacore.com>
* sem_disp.adb (Find_Controlling_Arg): Examine the call node before examining its original form, to handle properly operator calls that have been rewritten. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129337 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r--gcc/ada/sem_disp.adb16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 5924039e6f9..37eb9ed4196 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -1132,9 +1132,21 @@ package body Sem_Disp is
return Find_Controlling_Arg (Expression (Orig_Node));
end if;
- -- Dispatching on result case
+ -- Dispatching on result case. If expansion is disabled, the node still
+ -- has the structure of a function call. However, if the function name
+ -- is an operator and the call was given in infix form, the original
+ -- node has no controlling result and we must examine the current node.
+
+ if Nkind (N) = N_Function_Call
+ and then Present (Controlling_Argument (N))
+ and then Has_Controlling_Result (Entity (Name (N)))
+ then
+ return Controlling_Argument (N);
- if Nkind (Orig_Node) = N_Function_Call
+ -- If expansion is enabled, the call may have been transformed into
+ -- an indirect call, and we need to recover the original node.
+
+ elsif Nkind (Orig_Node) = N_Function_Call
and then Present (Controlling_Argument (Orig_Node))
and then Has_Controlling_Result (Entity (Name (Orig_Node)))
then