The Refined_Post aspect defined in SPARK 2014 should be considered like
a postcondition wrt issuing warnings on variable references.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-06-13  Yannick Moy  <m...@adacore.com>

        * sem_warn.adb (Check_Unset_References): Take
        case of Refined_Post into account in Within_Postcondition check.

Index: sem_warn.adb
===================================================================
--- sem_warn.adb        (revision 211609)
+++ sem_warn.adb        (working copy)
@@ -1810,8 +1810,9 @@
                      SE : constant Entity_Id := Scope (E);
 
                      function Within_Postcondition return Boolean;
-                     --  Returns True iff N is within a Postcondition, an
-                     --  Ensures component in a Test_Case, or a Contract_Cases.
+                     --  Returns True iff N is within a Postcondition, a
+                     --  Refined_Post, an Ensures component in a Test_Case,
+                     --  or a Contract_Cases.
 
                      --------------------------
                      -- Within_Postcondition --
@@ -1826,6 +1827,7 @@
                            if Nkind (Nod) = N_Pragma
                              and then Nam_In (Pragma_Name (Nod),
                                               Name_Postcondition,
+                                              Name_Refined_Post,
                                               Name_Contract_Cases)
                            then
                               return True;

Reply via email to