Commit 5b4f211d by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Preserve original CE reason in more cases

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
parent ed170742
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
checks.
......
......@@ -5707,9 +5707,16 @@ package body Sem_Eval is
-- 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment