From cce46226b0bb33c688398f861c70dbb06c3e7bda Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Fri, 21 May 2021 11:47:45 +0200 Subject: [PATCH] [Ada] Stronger assertion about flag for checking static expressions gcc/ada/ * sem_eval.adb (Set_Checking_Potentially_Static_Expression): Stronger assertion. --- gcc/ada/sem_eval.adb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 7a70fd83b2a..a3a28644909 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -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;