diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-02 11:59:32 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-09-02 11:59:32 +0200 |
commit | 5b5588dd53fd0da82e406f5de6e9f189f89f1b1a (patch) | |
tree | d6a82cb47f4f512aaf1cf08fce7c897f5ef759be /gcc/ada/sem_ch6.adb | |
parent | bd603506f6e92d29abc1f975ad7d356907ba25c2 (diff) | |
download | gcc-5b5588dd53fd0da82e406f5de6e9f189f89f1b1a.zip gcc-5b5588dd53fd0da82e406f5de6e9f189f89f1b1a.tar.gz gcc-5b5588dd53fd0da82e406f5de6e9f189f89f1b1a.tar.bz2 |
[multiple changes]
2011-09-02 Bob Duff <duff@adacore.com>
* sem_ch6.adb: (Check_Post_State): Suppress warning
"postcondition refers only to pre-state" when the expression has not
yet been analyzed, because it causes false alarms. This can happen when
the postcondition contains a quantified expression, because those are
analyzed later. This is a temporary/partial fix.
(Process_Post_Conditions): Minor: change wording of warning.
2011-09-02 Marc Sango <sango@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Detect the violation of
illegal use of unconstrained string type in SPARK mode.
* sem_res.adb (Analyze_Operator_Symbol): Set the
right place where the string operand of concatenation should be
violate in SPARK mode.
From-SVN: r178460
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 32c2dbb..bd1b6e3 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -5551,9 +5551,16 @@ package body Sem_Ch6 is declare E : constant Entity_Id := Entity (N); begin - if Is_Entity_Name (N) - and then Present (E) - and then Ekind (E) in Assignable_Kind + -- ???Quantified expressions get analyzed later, so E can be + -- empty at this point. In this case, we suppress the + -- warning, just in case E is assignable. It seems better to + -- have false negatives than false positives. At some point, + -- we should make the warning more accurate, either by + -- analyzing quantified expressions earlier, or moving this + -- processing later. + + if No (E) or else + (Is_Entity_Name (N) and then Ekind (E) in Assignable_Kind) then Found := True; end if; @@ -5627,7 +5634,7 @@ package body Sem_Ch6 is Ignored := Find_Post_State (Arg); if not Post_State_Mentioned then - Error_Msg_N ("?postcondition only refers to pre-state", + Error_Msg_N ("?postcondition refers only to pre-state", Prag); end if; end if; |