gcc/ada/
* exp_disp.adb (Build_Class_Wide_Check): Ensure that evaluation
of actuals is side effects free (since the check duplicates
actuals).
Str_Loc : constant String := Build_Location_String (Loc);
+ A : Node_Id;
Cond : Node_Id;
Msg : Node_Id;
Prec : Node_Id;
return;
end if;
+ -- Ensure that the evaluation of the actuals will not produce side
+ -- effects (since the check will use a copy of the actuals).
+
+ A := First_Actual (Call_Node);
+ while Present (A) loop
+ Remove_Side_Effects (A);
+ Next_Actual (A);
+ end loop;
+
-- The expression for the precondition is analyzed within the
-- generated pragma. The message text is the last parameter of
-- the generated pragma, indicating source of precondition.