[multiple changes]
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. From-SVN: r203558
This commit is contained in:
parent
4248145849
commit
43dbd3e338
5 changed files with 22 additions and 5 deletions
|
@ -1,3 +1,13 @@
|
|||
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.
|
||||
|
|
|
@ -1160,7 +1160,6 @@ package body Sem_Aux is
|
|||
|
||||
begin
|
||||
N := Parent (Pack_Id);
|
||||
|
||||
while Nkind (N) /= N_Package_Specification loop
|
||||
N := Parent (N);
|
||||
|
||||
|
|
|
@ -351,5 +351,5 @@ package Sem_Aux is
|
|||
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;
|
||||
|
|
|
@ -19971,16 +19971,15 @@ package body Sem_Prag is
|
|||
|
||||
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);
|
||||
|
|
|
@ -3933,6 +3933,15 @@ package body Sem_Res is
|
|||
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???
|
||||
|
|
Loading…
Add table
Reference in a new issue