AI12-0217 made changes in the rules for 'Old; make analogous changes for
'Loop_Entry. In particular, where the rules used to require that the
attribute prefix must "statically denote" an object in some cases, those
rules have been relaxed to say that the prefix must "statically name" an
object instead. The significance of this is that it is now ok, at least
in many cases, to name a subcomponent of a top-level object in the
attribute prefix, as opposed to only being able to name the top-level
object. An accompanying SPARK RM wording change will be forthcoming
soon. The changes for AI12-0217 included a fix in the old
Statically_Denotes_Object predicate which caused the old rules to be
enforced correctly - this had the effect of introducing a regression
which is corrected via this change.

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

2020-06-15  Steve Baird  <ba...@adacore.com>

gcc/ada/

        * sem_attr.adb (Analyze_Attribute): In the Loop_Entry case,
        replace a call to Statically_Denotes_Object with a call to
        Statically_Names_Object and clean up the preceding comment.
--- gcc/ada/sem_attr.adb
+++ gcc/ada/sem_attr.adb
@@ -4541,13 +4541,13 @@ package body Sem_Attr is
 
          Check_References_In_Prefix (Loop_Id);
 
-         --  The prefix must denote a static entity if the pragma does not
+         --  The prefix must statically name an object if the pragma does not
          --  apply to the innermost enclosing loop statement, or if it appears
-         --  within a potentially unevaluated epxression.
+         --  within a potentially unevaluated expression.
 
          if Is_Entity_Name (P)
            or else Nkind (Parent (P)) = N_Object_Renaming_Declaration
-           or else Statically_Denotes_Object (P)
+           or else Statically_Names_Object (P)
          then
             null;
 

Reply via email to