mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-12 20:21:45 +08:00
[Ada] Accept raise expressions as operands of boolean operators
This patch restores the previous behaviour of a recently rewritten routine Sem_Ch4.Find_Boolean_Types for boolean operators where one of the operands is a raise-expression, e.g.: (raise Program_Error or else (X /= Y)) This change is required for the Entity field of the "or else" operator to be set. For GNAT it doesn't matter, but GNATprove requires this field to be set. The affected call sequence starts at Find_Boolean_Types, goes via Check_Right_Argument and Check_Boolean_Pair to Valid_Boolean_Arg, which ultimately guards a call to Add_One_Interp. gcc/ada/ * sem_type.adb (Valid_Boolean_Arg): Operands of Raise_Type are valid boolean arguments.
This commit is contained in:
parent
9da379f1c2
commit
c97014ce88
@ -3507,6 +3507,7 @@ package body Sem_Type is
|
||||
or else Is_Modular_Integer_Type (T)
|
||||
or else T = Universal_Integer
|
||||
or else T = Any_Composite
|
||||
or else T = Raise_Type
|
||||
then
|
||||
return True;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user