diff options
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 7d0ca02..56aee5a 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1621,14 +1621,25 @@ package body Sem_Ch13 is -- do not delay, since we know the value cannot change. -- This optimization catches most rep clause cases. - if (Present (Expr) and then Nkind (Expr) = N_Integer_Literal) - or else (A_Id in Boolean_Aspects and then No (Expr)) - then - Delay_Required := False; - else - Delay_Required := True; - Set_Has_Delayed_Rep_Aspects (E); - end if; + -- For Boolean aspects, don't delay if no expression + + if A_Id in Boolean_Aspects and then No (Expr) then + Delay_Required := False; + + -- For non-Boolean aspects, don't delay if integer literal + + elsif A_Id not in Boolean_Aspects + and then Present (Expr) + and then Nkind (Expr) = N_Integer_Literal + then + Delay_Required := False; + + -- All other cases are delayed + + else + Delay_Required := True; + Set_Has_Delayed_Rep_Aspects (E); + end if; end case; -- Processing based on specific aspect |