diff options
author | Ed Schonberg <schonberg@adacore.com> | 2006-02-17 17:05:24 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-17 17:05:24 +0100 |
commit | 69e6a03e46224219467e99564de4f370656931a5 (patch) | |
tree | f257f7078871c206894f16e951ce83cb5e3cb562 | |
parent | 24ca2a963aabc8157443c3a39f9fdc2bb728ca49 (diff) | |
download | gcc-69e6a03e46224219467e99564de4f370656931a5.zip gcc-69e6a03e46224219467e99564de4f370656931a5.tar.gz gcc-69e6a03e46224219467e99564de4f370656931a5.tar.bz2 |
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
-rw-r--r-- | gcc/ada/sem_ch4.adb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 06669fb..ac5f38d 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 |