From: Viljar Indus <[email protected]>

Avoid marking multiple errors on the same line if the ghost
expression is both non-static and also would evaluate to False.

gcc/ada/ChangeLog:

        * sem_prag.adb (Analyze_Abstract_State): make error checks
        exclusive.

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

---
 gcc/ada/sem_prag.adb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index e3f1ed0e085..a22ae61cd55 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -13595,9 +13595,7 @@ package body Sem_Prag is
                                           & "in pragma % "
                                           & "must be static"),
                                        Expr);
-                                 end if;
-
-                                 if Is_False (Expr_Value (Expr)) then
+                                 elsif Is_False (Expr_Value (Expr)) then
                                     Is_Ghost := False;
 
                                     --  "Ghostness" cannot be turned off once
-- 
2.53.0

Reply via email to