aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.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_ch5.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_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index e7f464e..a29aece 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1580,8 +1580,14 @@ package body Sem_Ch5 is
-- Warn on redundant if statement that has no effect
+ -- Note, we could also check empty ELSIF parts ???
+
if Warn_On_Redundant_Constructs
+ -- If statement must be from source
+
+ and then Comes_From_Source (N)
+
-- Condition must not have obvious side effect
and then Has_No_Obvious_Side_Effects (Condition (N))