diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-08-26 13:18:48 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-23 04:24:39 -0400 |
commit | 9d0761c76b6b3a1831f2118a570cc82ac5bc0ace (patch) | |
tree | 88737cc0792fff3b28f5cc17405d379a2a93261b | |
parent | 9a83366b62e585cce5577309013a832f895ccdbf (diff) | |
download | gcc-9d0761c76b6b3a1831f2118a570cc82ac5bc0ace.zip gcc-9d0761c76b6b3a1831f2118a570cc82ac5bc0ace.tar.gz gcc-9d0761c76b6b3a1831f2118a570cc82ac5bc0ace.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/sem_prag.adb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b4744bf..409ff76 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); + + <<Leave>> + -- 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; --------------------------------- |