[Ada] Accept raise expressions as operands of boolean operators
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 9 Feb 2022 16:15:27 +0000 (17:15 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 12 May 2022 12:38:37 +0000 (12:38 +0000)
commitc97014ce88150584689a2ae9a95d8a40115e0423
tree9cc707ab4055e6aeddca6949ea370ce16bdd258d
parent9da379f1c220740c236ccfe223af5b435fe72284
[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.
gcc/ada/sem_type.adb