From: Piotr Trojanek Date: Wed, 26 Aug 2020 11:18:48 +0000 (+0200) Subject: [Ada] Fix default value for re-analysis of external property pragmas X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d0761c76b6b3a1831f2118a570cc82ac5bc0ace;p=gcc.git [Ada] Fix default value for re-analysis of external property pragmas gcc/ada/ * sem_prag.adb (Analyze_External_Property_In_Decl_Part): Set the output parameter Expr_Val to the (implicit) pragma argument even when returning early. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b4744bfa592..409ff76094a 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2101,12 +2101,11 @@ package body Sem_Prag is Expr : Node_Id; begin - Expr_Val := False; - - -- Do not analyze the pragma multiple times + -- Do not analyze the pragma multiple times, but set the output + -- parameter to the argument specified by the pragma. if Is_Analyzed_Pragma (N) then - return; + goto Leave; end if; Error_Msg_Name_1 := Pragma_Name (N); @@ -2147,6 +2146,10 @@ package body Sem_Prag is end if; end if; + Set_Is_Analyzed_Pragma (N); + + <> + -- Ensure that the Boolean expression (if present) is static. A missing -- argument defaults the value to True (SPARK RM 7.1.2(5)). @@ -2160,7 +2163,6 @@ package body Sem_Prag is end if; end if; - Set_Is_Analyzed_Pragma (N); end Analyze_External_Property_In_Decl_Part; ---------------------------------