]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:50:16 +0000 (15:50 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:50:16 +0000 (15:50 +0200)
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

gcc/ada/ChangeLog
gcc/ada/sem_aux.adb
gcc/ada/sem_aux.ads
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb

index 986d97bf36fa7b0a1572960955f96a04f63c047d..d155557eff5a299e0b1719fd492a38d40465e373 100644 (file)
@@ -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.
index 5a4c4384320183c8628e48118de4471d30e9d6b5..5c2b5df89b656ccce3cb778dfe8df570a3e246a7 100644 (file)
@@ -1160,7 +1160,6 @@ package body Sem_Aux is
 
    begin
       N := Parent (Pack_Id);
-
       while Nkind (N) /= N_Package_Specification loop
          N := Parent (N);
 
index d493059c42f39027ce23b732c0d7d12be0f9a497..a4b1a673bce9c01080170b13cac57cf61dcfb8f5 100644 (file)
@@ -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;
index ee790ad4aea33e20a317497d83f042d47a42642c..69df1759b55ba0ff89795f1240a49d8fa47528f2 100644 (file)
@@ -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);
index ca2b551136df7368bc9094b7d54d879e90c460e6..3cb49f416a78e3a99b79057602b111f928cdd48d 100644 (file)
@@ -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???