Commit 719aaf4d by Arnaud Charlet

[multiple changes]

2010-06-22  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Add_Implicit_Operator): If the context of the expanded
	name is a call, use the number of actuals to determine whether this is
	a binary or unary operator, rather than relying on later information
	to resolve the overload.

2010-06-22  Robert Dewar  <dewar@adacore.com>

	* sem_ch10.adb, sem_aggr.adb: Minor reformatting.

From-SVN: r161142
parent 946db1e2
2010-06-22 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Add_Implicit_Operator): If the context of the expanded
name is a call, use the number of actuals to determine whether this is
a binary or unary operator, rather than relying on later information
to resolve the overload.
2010-06-22 Robert Dewar <dewar@adacore.com>
* sem_ch10.adb, sem_aggr.adb: Minor reformatting.
2010-06-22 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, sem_disp.adb: Minor code fixes.
......
......@@ -3610,7 +3610,6 @@ package body Sem_Aggr is
New_Aggr : Node_Id;
begin
Inner_Comp := First_Component (Etype (Comp));
while Present (Inner_Comp) loop
Comp_Type := Etype (Inner_Comp);
......
......@@ -2208,7 +2208,6 @@ package body Sem_Ch10 is
if Present (Enclosing_Child) then
Install_Siblings (Enclosing_Child, N);
end if;
end if;
Analyze (Proper_Body (Unit (N)));
......
......@@ -6029,13 +6029,44 @@ package body Sem_Ch8 is
Change_Selected_Component_To_Expanded_Name (N);
end if;
-- If the context is an unanalyzed function call, determine whether
-- a binary or unary interpretation is required.
if Nkind (Parent (N)) = N_Indexed_Component then
declare
Is_Binary_Call : constant Boolean
:= Present (Next (First (Expressions (Parent (N)))));
Is_Binary_Op : constant Boolean
:= First_Entity (Predef_Op) /= Last_Entity (Predef_Op);
Predef_Op2 : constant Entity_Id := Homonym (Predef_Op);
begin
if Is_Binary_Call then
if Is_Binary_Op then
Add_One_Interp (N, Predef_Op, T);
else
Add_One_Interp (N, Predef_Op2, T);
end if;
-- For operators with unary and binary interpretations, add both
else
if not Is_Binary_Op then
Add_One_Interp (N, Predef_Op, T);
else
Add_One_Interp (N, Predef_Op2, T);
end if;
end if;
end;
else
Add_One_Interp (N, Predef_Op, T);
-- For operators with unary and binary interpretations, if
-- context is not a call, add both
if Present (Homonym (Predef_Op)) then
Add_One_Interp (N, Homonym (Predef_Op), T);
end if;
end if;
-- The node is a reference to a predefined operator, and
-- an implicit reference to the type of its operands.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment