+2013-10-14 Robert Dewar <dewar@adacore.com>
+
+ * sem_aux.adb, sem_aux.ads, sem_prag.adb: Minor reformatting.
+
+2013-10-14 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Resolve_Actuals): Add error message for a
+ subprogram with an in-out parameter when used in a predicate,
+ to clarify subsequent error at the point of call.
+
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Is_Matching_Input): Consume a matching null input.
begin
N := Parent (Pack_Id);
-
while Nkind (N) /= N_Package_Specification loop
N := Parent (N);
function Package_Specification (Pack_Id : Entity_Id) return Node_Id;
-- Given an entity for a package or generic package, return corresponding
-- package specification. Simplifies handling of child units, and better
- -- than the old idiom: Specification (Unit_Declaration_Node (Pack_Id).
+ -- than the old idiom: Specification (Unit_Declaration_Node (Pack_Id)).
end Sem_Aux;
if Nkind (Ref_Input) = N_Null then
Remove (Ref_Input);
-
return True;
+
else
Match_Error
("null input cannot be matched in corresponding "
& "refinement clause", Dep_Input);
end if;
- -- The remaining cases are formal parameters, variables and
- -- states.
+ -- Remaining cases are formal parameters, variables, and states
else
Dep_Id := Entity_Of (Dep_Input);
and then not Is_Init_Proc (Nam)
then
Error_Msg_NE ("actual for& must be a variable", A, F);
+
+ if Is_Subprogram (Current_Scope)
+ and then
+ (Is_Invariant_Procedure (Current_Scope)
+ or else Is_Predicate_Function (Current_Scope))
+ then
+ Error_Msg_N ("function used in predicate cannot " &
+ "modify its argument", F);
+ end if;
end if;
-- What's the following about???