diff options
Diffstat (limited to 'gcc/ada/sem_ch11.adb')
-rw-r--r-- | gcc/ada/sem_ch11.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 180ecc6..c5b92e2 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -489,7 +489,10 @@ package body Sem_Ch11 is Par : Node_Id; begin - Check_SPARK_Restriction ("raise statement is not allowed", N); + if Comes_From_Source (N) then + Check_SPARK_Restriction ("raise statement is not allowed", N); + end if; + Check_Unreachable_Code (N); -- Check exception restrictions on the original source @@ -687,7 +690,9 @@ package body Sem_Ch11 is -- Start of processing for Analyze_Raise_xxx_Error begin - Check_SPARK_Restriction ("raise statement is not allowed", N); + if Nkind (Original_Node (N)) = N_Raise_Statement then + Check_SPARK_Restriction ("raise statement is not allowed", N); + end if; if No (Etype (N)) then Set_Etype (N, Standard_Void_Type); |