diff options
author | Yannick Moy <moy@adacore.com> | 2023-09-12 09:54:32 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-09-26 13:43:17 +0200 |
commit | 92361698288fd3192655f409f603b88b0aa182b8 (patch) | |
tree | 06fcd242e99e69ed8dcf30af827e15f746360b31 /gcc | |
parent | d324984f9fa50e0055e3818f29d8c019df08cecf (diff) | |
download | gcc-92361698288fd3192655f409f603b88b0aa182b8.zip gcc-92361698288fd3192655f409f603b88b0aa182b8.tar.gz gcc-92361698288fd3192655f409f603b88b0aa182b8.tar.bz2 |
ada: Clarify RM references that justify a constraint check
gcc/ada/
* exp_ch5.adb (Expand_N_Case_Statement): Reference both sections
of the Ada RM that deal with case statements and case expressions
to justify the insertion of a runtime check.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_ch5.adb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index d55fdb3..cd3b02b 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -4092,8 +4092,9 @@ package body Exp_Ch5 is end if; -- First step is to worry about possible invalid argument. The RM - -- requires (RM 5.4(13)) that if the result is invalid (e.g. it is - -- outside the base range), then Constraint_Error must be raised. + -- requires (RM 4.5.7 (21/3) and 5.4 (13)) that if the result is + -- invalid (e.g. it is outside the base range), then Constraint_Error + -- must be raised. -- Case of validity check required (validity checks are on, the -- expression is not known to be valid, and the case statement @@ -4274,7 +4275,7 @@ package body Exp_Ch5 is -- If Predicates_Ignored is true the value does not satisfy the -- predicate, and there is no Others choice, Constraint_Error - -- must be raised (4.5.7 (21/3)). + -- must be raised (RM 4.5.7 (21/3) and 5.4 (13)). if Predicates_Ignored (Etype (Expr)) then declare |