2018-07-17 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
cases.
From-SVN: r262802
+2018-07-17 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_eval.adb (Rewrite_In_Raise_CE): Keep the original reason in more
+ cases.
+
2018-07-17 Arnaud Charlet <charlet@adacore.com>
* checks.adb (Apply_Division_Check): Add provision for floating-point
-- Else build an explicit N_Raise_CE
else
- Rewrite (N,
- Make_Raise_Constraint_Error (Sloc (Exp),
- Reason => CE_Range_Check_Failed));
+ if Nkind (Exp) = N_Raise_Constraint_Error then
+ Rewrite (N,
+ Make_Raise_Constraint_Error (Sloc (Exp),
+ Reason => Reason (Exp)));
+ else
+ Rewrite (N,
+ Make_Raise_Constraint_Error (Sloc (Exp),
+ Reason => CE_Range_Check_Failed));
+ end if;
+
Set_Raises_Constraint_Error (N);
Set_Etype (N, Typ);
end if;