aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-10-14 15:50:16 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-14 15:50:16 +0200
commit43dbd3e338b914681b7d8d90daef7caf5ea6b9fd (patch)
tree00f2cf694b13182947ff6c464c02656376e618d9 /gcc/ada
parent4248145849940945d7c74d0f86876f220bbab8a1 (diff)
downloadgcc-43dbd3e338b914681b7d8d90daef7caf5ea6b9fd.zip
gcc-43dbd3e338b914681b7d8d90daef7caf5ea6b9fd.tar.gz
gcc-43dbd3e338b914681b7d8d90daef7caf5ea6b9fd.tar.bz2
[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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/sem_aux.adb1
-rw-r--r--gcc/ada/sem_aux.ads2
-rw-r--r--gcc/ada/sem_prag.adb5
-rw-r--r--gcc/ada/sem_res.adb9
5 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 986d97b..d155557 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
index 5a4c438..5c2b5df 100644
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -1160,7 +1160,6 @@ package body Sem_Aux is
begin
N := Parent (Pack_Id);
-
while Nkind (N) /= N_Package_Specification loop
N := Parent (N);
diff --git a/gcc/ada/sem_aux.ads b/gcc/ada/sem_aux.ads
index d493059..a4b1a67 100644
--- a/gcc/ada/sem_aux.ads
+++ b/gcc/ada/sem_aux.ads
@@ -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;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index ee790ad..69df175 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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);
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index ca2b551..3cb49f4 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -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???