diff options
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r-- | gcc/ada/sem_ch4.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 1e49456..e04773a 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -1524,15 +1524,21 @@ package body Sem_Ch4 is Else_Expr := Next (Then_Expr); - -- In ALFA, conditional expressions are allowed: + -- In ALFA, boolean conditional expressions are allowed: -- * if they have no ELSE part, in which case the expression is -- equivalent to + -- NOT Condition OR ELSE Then_Expr + -- * in pre- and postconditions, where the Condition cannot have side- -- effects (in ALFA) and thus the expression is equivalent to + -- (Condition AND THEN Then_Expr) -- and (NOT Condition AND THEN Then_Expr) + -- Non-boolean conditional expressions are marked as not in ALFA during + -- resolution. + if Present (Else_Expr) and then not In_Pre_Post_Expression then Mark_Non_ALFA_Subprogram; end if; |