diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-10 15:17:07 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-10 15:17:07 +0200 |
commit | 08988ed947922e00ee6d0c0ecb9a6de01cdc7238 (patch) | |
tree | 97f38666666d88b403845139074482f4255266f7 /gcc/ada/restrict.adb | |
parent | de6a560804ad384b70a8697fcba8d0dc632e3382 (diff) | |
download | gcc-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/restrict.adb')
-rw-r--r-- | gcc/ada/restrict.adb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index ea0f89c..668c444 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -1406,9 +1406,30 @@ package body Restrict is is Msg_Issued : Boolean; Save_Error_Msg_Sloc : Source_Ptr; + Onode : constant Node_Id := Original_Node (N); begin - if Force or else Comes_From_Source (Original_Node (N)) then + -- Output message if Force set + + if Force + + -- Or if this node comes from source + + or else Comes_From_Source (N) + + -- Or if this is a range node which rewrites a range attribute and + -- the range attribute comes from source. + + or else (Nkind (N) = N_Range + and then Nkind (Onode) = N_Attribute_Reference + and then Attribute_Name (Onode) = Name_Range + and then Comes_From_Source (Onode)) + + -- Or this is an expression that does not come from source, which is + -- a rewriting of an expression that does come from source. + + or else (Nkind (N) in N_Subexpr and then Comes_From_Source (Onode)) + then if Restriction_Check_Required (SPARK_05) and then Is_In_Hidden_Part_In_SPARK (Sloc (N)) then |