public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Expect Exceptional_Cases as a context for attribute Old
@ 2023-05-25  8:06 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-05-25  8:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

From: Piotr Trojanek <trojanek@adacore.com>

When determining whether attribute Old is evaluated conditionally, we
must also expect it to appear in the recently added contract
Exceptional_Cases.

gcc/ada/

	* sem_util.adb (Determining_Expressions): Fix style; fix layout and
	ordering of pragma names; expect pragma Exceptional_Cases.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_util.adb | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 6b5abc92c96..aabd01747fc 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -30651,9 +30651,9 @@ package body Sem_Util is
            (Expr : Node_Id; Expr_Trailer : Node_Id := Empty)
            return Determining_Expression_List
          is
-            Par           : Node_Id := Expr;
-            Trailer       : Node_Id := Expr_Trailer;
-            Next_Element  : Determining_Expr;
+            Par          : Node_Id := Expr;
+            Trailer      : Node_Id := Expr_Trailer;
+            Next_Element : Determining_Expr;
          begin
             --  We want to stop climbing up the tree when we reach the
             --  postcondition expression. An aspect_specification is
@@ -30761,9 +30761,13 @@ package body Sem_Util is
                         else
                            pragma Assert
                              (Get_Pragma_Id (Pragma_Name (Par)) in
-                                Pragma_Post | Pragma_Postcondition
-                                | Pragma_Post_Class | Pragma_Refined_Post
-                                | Pragma_Check | Pragma_Contract_Cases);
+                                Pragma_Check
+                              | Pragma_Contract_Cases
+                              | Pragma_Exceptional_Cases
+                              | Pragma_Post
+                              | Pragma_Postcondition
+                              | Pragma_Post_Class
+                              | Pragma_Refined_Post);
 
                            return (1 .. 0 => <>); -- recursion terminates here
                         end if;
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-25  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25  8:06 [COMMITTED] ada: Expect Exceptional_Cases as a context for attribute Old Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).