summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-14 12:39:11 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-14 12:39:11 +0000
commitea3fc544579ba489ef516cf582792b475ce78b67 (patch)
tree1fb2911c836fb268a03419df52276af6a0e1cec8 /gcc/ada/sem_ch4.adb
parentc8dfb75f1a223e0cef87bb2be0c99594969b6dc3 (diff)
downloadgcc-ea3fc544579ba489ef516cf582792b475ce78b67.tar.gz
2016-06-14 Bob Duff <duff@adacore.com>
* sem_elab.adb (Check_A_Call): Do nothing if the callee is (or is in) an instance, and the caller is outside. Misc cleanup. 2016-06-14 Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Analyze_Quantified_Expression): Generating C code avoid spurious warning on loop variable of inlinined postconditions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237438 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 20d1a740765..edcfee226d5 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -3917,7 +3917,16 @@ package body Sem_Ch4 is
if Warn_On_Suspicious_Contract
and then not Referenced (Loop_Id, Cond)
then
- Error_Msg_N ("?T?unused variable &", Loop_Id);
+ -- Generating C this check causes spurious warnings on inlined
+ -- postconditions; we can safely disable it because this check
+ -- was previously performed when analying the internally built
+ -- postconditions procedure.
+
+ if Modify_Tree_For_C and then In_Inlined_Body then
+ null;
+ else
+ Error_Msg_N ("?T?unused variable &", Loop_Id);
+ end if;
end if;
-- Diagnose a possible misuse of the SOME existential quantifier. When