]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Stronger assertion about flag for checking static expressions
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 21 May 2021 09:47:45 +0000 (11:47 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 7 Jul 2021 16:23:19 +0000 (16:23 +0000)
gcc/ada/

* sem_eval.adb (Set_Checking_Potentially_Static_Expression):
Stronger assertion.

gcc/ada/sem_eval.adb

index 7a70fd83b2a516d929d624c5f77959d5b632f6e9..a3a286449094c9f788e31692bec07f1c1ac1e507 100644 (file)
@@ -6481,11 +6481,10 @@ package body Sem_Eval is
 
    procedure Set_Checking_Potentially_Static_Expression (Value : Boolean) is
    begin
-      --  Verify that we're not currently checking for a potentially static
-      --  expression unless we're disabling such checking.
+      --  Verify that we only start/stop checking for a potentially static
+      --  expression and do not start or stop it twice in a row.
 
-      pragma Assert
-        (not Checking_For_Potentially_Static_Expression or else not Value);
+      pragma Assert (Checking_For_Potentially_Static_Expression /= Value);
 
       Checking_For_Potentially_Static_Expression := Value;
    end Set_Checking_Potentially_Static_Expression;