sem_ch4.adb (Find_Boolean_Types): If one of the operands is an aggregate...
2006-02-17 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Find_Boolean_Types): If one of the operands is an aggregate, check the interpretations of the other operand to find one that may be a boolean array. (Analyze_Selected_Component): Fix flow-of-control typo in case where the prefix is a private extension. From-SVN: r111182
This commit is contained in:
parent
24ca2a963a
commit
69e6a03e46
@ -2953,7 +2953,7 @@ package body Sem_Ch4 is
|
|||||||
Set_Entity_With_Style_Check (Sel, Comp);
|
Set_Entity_With_Style_Check (Sel, Comp);
|
||||||
Set_Etype (Sel, Etype (Comp));
|
Set_Etype (Sel, Etype (Comp));
|
||||||
Set_Etype (N, Etype (Comp));
|
Set_Etype (N, Etype (Comp));
|
||||||
exit;
|
return;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
Next_Component (Comp);
|
Next_Component (Comp);
|
||||||
@ -3841,6 +3841,31 @@ package body Sem_Ch4 is
|
|||||||
end loop;
|
end loop;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
-- If operands are aggregates, we must assume that they may be
|
||||||
|
-- boolean arrays, and leave disambiguation for the second pass.
|
||||||
|
-- If only one is an aggregate, verify that the other one has an
|
||||||
|
-- interpretation as a boolean array
|
||||||
|
|
||||||
|
elsif Nkind (L) = N_Aggregate then
|
||||||
|
if Nkind (R) = N_Aggregate then
|
||||||
|
Add_One_Interp (N, Op_Id, Etype (L));
|
||||||
|
|
||||||
|
elsif not Is_Overloaded (R) then
|
||||||
|
if Valid_Boolean_Arg (Etype (R)) then
|
||||||
|
Add_One_Interp (N, Op_Id, Etype (R));
|
||||||
|
end if;
|
||||||
|
|
||||||
|
else
|
||||||
|
Get_First_Interp (R, Index, It);
|
||||||
|
while Present (It.Typ) loop
|
||||||
|
if Valid_Boolean_Arg (It.Typ) then
|
||||||
|
Add_One_Interp (N, Op_Id, It.Typ);
|
||||||
|
end if;
|
||||||
|
|
||||||
|
Get_Next_Interp (Index, It);
|
||||||
|
end loop;
|
||||||
|
end if;
|
||||||
|
|
||||||
elsif Valid_Boolean_Arg (Etype (L))
|
elsif Valid_Boolean_Arg (Etype (L))
|
||||||
and then Has_Compatible_Type (R, Etype (L))
|
and then Has_Compatible_Type (R, Etype (L))
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user