aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch11.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 15:17:07 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-10 15:17:07 +0200
commit08988ed947922e00ee6d0c0ecb9a6de01cdc7238 (patch)
tree97f38666666d88b403845139074482f4255266f7 /gcc/ada/sem_ch11.adb
parentde6a560804ad384b70a8697fcba8d0dc632e3382 (diff)
downloadgcc-08988ed947922e00ee6d0c0ecb9a6de01cdc7238.zip
gcc-08988ed947922e00ee6d0c0ecb9a6de01cdc7238.tar.gz
gcc-08988ed947922e00ee6d0c0ecb9a6de01cdc7238.tar.bz2
[multiple changes]
2013-10-10 Robert Dewar <dewar@adacore.com> * par-ch6.adb (Check_Junk_Semicolon_Before_Return): Remove junk code. 2013-10-10 Javier Miranda <miranda@adacore.com> * sem_ch13.adb (Freeze_Entity_Checks): Avoid loosing errors on CPP entities in -gnatc mode. 2013-10-10 Robert Dewar <dewar@adacore.com> * sem_ch5.adb (Analyze_If_Statement): Only diagnose redundant if from source. 2013-10-10 Robert Dewar <dewar@adacore.com> * restrict.adb (Check_SPARK_Restriction): Refine test (don't automatically go to the original node). * sem_ch11.adb (Analyze_Raise_Statement): Only raise statements that come from source violate SPARK restrictions. (Analyze_Raise_xxx_Error): Same fix. * sem_ch3.adb (Analyze_Object_Declaration): Check OK SPARK initialization on original node, not on possibly rewritten expression. * sem_ch4.adb (Analyze_If_Expression): Only if expressions that come from source violate SPARK mode restrictions. 2013-10-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Fix confusing documentation for -gnatyM. From-SVN: r203374
Diffstat (limited to 'gcc/ada/sem_ch11.adb')
-rw-r--r--gcc/ada/sem_ch11.adb9
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);