From: Viljar Indus Date: Tue, 31 Mar 2026 09:04:37 +0000 (+0300) Subject: ada: Avoid giving multiple errors on ghost argument X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5200b096cedd09a51fecffebc19ae699d2d5a160;p=thirdparty%2Fgcc.git ada: Avoid giving multiple errors on ghost argument 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. --- 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