diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-12-07 16:58:59 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-06 17:11:40 +0000 |
commit | a17774924232ef28d8f6ddd627a01c458c91c76b (patch) | |
tree | 745a26a4063b47f78bcf6a5aeb0b5958ca0178f0 | |
parent | a9f0ee1dfc2a083ede548e38f9c2554163a87a16 (diff) | |
download | gcc-a17774924232ef28d8f6ddd627a01c458c91c76b.zip gcc-a17774924232ef28d8f6ddd627a01c458c91c76b.tar.gz gcc-a17774924232ef28d8f6ddd627a01c458c91c76b.tar.bz2 |
[Ada] Move messages on division by zero to the right operand
gcc/ada/
* sem_eval.adb (Eval_Arithmetic_Op): Add Loc parameter to all
calls to Apply_Compile_Time_Constraint_Error related to division
by zero.
-rw-r--r-- | gcc/ada/sem_eval.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 33303c4..f85efc2 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -2117,6 +2117,7 @@ package body Sem_Eval is Apply_Compile_Time_Constraint_Error (N, "division by zero", CE_Divide_By_Zero, + Loc => Sloc (Right), Warn => not Stat or SPARK_Mode = On); return; @@ -2139,6 +2140,7 @@ package body Sem_Eval is Apply_Compile_Time_Constraint_Error (N, "mod with zero divisor", CE_Divide_By_Zero, + Loc => Sloc (Right), Warn => not Stat or SPARK_Mode = On); return; @@ -2159,6 +2161,7 @@ package body Sem_Eval is Apply_Compile_Time_Constraint_Error (N, "rem with zero divisor", CE_Divide_By_Zero, + Loc => Sloc (Right), Warn => not Stat or SPARK_Mode = On); return; @@ -2218,7 +2221,8 @@ package body Sem_Eval is else pragma Assert (Nkind (N) = N_Op_Divide); if UR_Is_Zero (Right_Real) then Apply_Compile_Time_Constraint_Error - (N, "division by zero", CE_Divide_By_Zero); + (N, "division by zero", CE_Divide_By_Zero, + Loc => Sloc (Right)); return; end if; |