[Ada] Set Raises_CE flag only in Apply_Compile_Time_Constraint_Error
gcc/ada/ * sem_ch4.adb (Analyze_Selected_Component): Remove explicit call to Set_Raises_Constraint_Error on statically missing component. * sem_eval.adb (Eval_Arithmetic_Op): Likewise for static divisions by integer and real zeros. * sem_util.adb (Apply_Compile_Time_Constraint_Error): Call Set_Raises_Constraint_Error before exiting early in GNATprove mode.
This commit is contained in:
parent
55b93bbc21
commit
0632f86866
@ -5452,8 +5452,6 @@ package body Sem_Ch4 is
|
|||||||
(N, "component not present in }??",
|
(N, "component not present in }??",
|
||||||
CE_Discriminant_Check_Failed,
|
CE_Discriminant_Check_Failed,
|
||||||
Ent => Prefix_Type);
|
Ent => Prefix_Type);
|
||||||
|
|
||||||
Set_Raises_Constraint_Error (N);
|
|
||||||
return;
|
return;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
@ -2124,7 +2124,6 @@ package body Sem_Eval is
|
|||||||
Apply_Compile_Time_Constraint_Error
|
Apply_Compile_Time_Constraint_Error
|
||||||
(N, "division by zero", CE_Divide_By_Zero,
|
(N, "division by zero", CE_Divide_By_Zero,
|
||||||
Warn => not Stat or SPARK_Mode = On);
|
Warn => not Stat or SPARK_Mode = On);
|
||||||
Set_Raises_Constraint_Error (N);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
-- Otherwise we can do the division
|
-- Otherwise we can do the division
|
||||||
@ -2226,7 +2225,6 @@ package body Sem_Eval is
|
|||||||
if UR_Is_Zero (Right_Real) then
|
if UR_Is_Zero (Right_Real) then
|
||||||
Apply_Compile_Time_Constraint_Error
|
Apply_Compile_Time_Constraint_Error
|
||||||
(N, "division by zero", CE_Divide_By_Zero);
|
(N, "division by zero", CE_Divide_By_Zero);
|
||||||
Set_Raises_Constraint_Error (N);
|
|
||||||
return;
|
return;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
@ -1436,6 +1436,7 @@ package body Sem_Util is
|
|||||||
-- generate a check message.
|
-- generate a check message.
|
||||||
|
|
||||||
if GNATprove_Mode then
|
if GNATprove_Mode then
|
||||||
|
Set_Raises_Constraint_Error (N);
|
||||||
return;
|
return;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user