From 69e6a03e46224219467e99564de4f370656931a5 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Fri, 17 Feb 2006 17:05:24 +0100 Subject: [PATCH] sem_ch4.adb (Find_Boolean_Types): If one of the operands is an aggregate... 2006-02-17 Ed Schonberg * 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 --- gcc/ada/sem_ch4.adb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 06669fb4a17..ac5f38da2ce 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -2953,7 +2953,7 @@ package body Sem_Ch4 is Set_Entity_With_Style_Check (Sel, Comp); Set_Etype (Sel, Etype (Comp)); Set_Etype (N, Etype (Comp)); - exit; + return; end if; Next_Component (Comp); @@ -3841,6 +3841,31 @@ package body Sem_Ch4 is end loop; 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)) and then Has_Compatible_Type (R, Etype (L)) then -- 2.30.2