aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch11.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 14:26:50 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-27 14:26:50 +0200
commit814cc240b86e6eaf192ea958fa4eb08e87683840 (patch)
treedcad9d68ef254b3e6a08b7ef6c8ea405ae9f3418 /gcc/ada/sem_ch11.adb
parent24d2fbbeacb37a9a07ae7b038ce331630141aa10 (diff)
downloadgcc-814cc240b86e6eaf192ea958fa4eb08e87683840.zip
gcc-814cc240b86e6eaf192ea958fa4eb08e87683840.tar.gz
gcc-814cc240b86e6eaf192ea958fa4eb08e87683840.tar.bz2
[multiple changes]
2016-04-27 Arnaud Charlet <charlet@adacore.com> * s-rident.ads: Make No_Implicit_Loops non partition wide. 2016-04-27 Arnaud Charlet <charlet@adacore.com> * sem_ch11.adb (Analyze_Handled_Statements): check useless assignments also in entries and task bodies, not only in procedures and declaration blocks. * sem_ch5.adb (Analyze_Block_Statement): check useless assignements in declaration blocks as part of processing their handled statement sequence, just like it was done for procedures and now is also done for entries and task bodies. * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries of entries and task bodies just like of procedures. 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (Is_Volatile_Function): Recognize a function declared within a protected type as well as the protected/unprotected version of a function. From-SVN: r235491
Diffstat (limited to 'gcc/ada/sem_ch11.adb')
-rw-r--r--gcc/ada/sem_ch11.adb17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb
index e03ec1c..381972d 100644
--- a/gcc/ada/sem_ch11.adb
+++ b/gcc/ada/sem_ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -417,14 +417,15 @@ package body Sem_Ch11 is
Analyze_Statements (Statements (N));
- -- If the current scope is a subprogram, then this is the right place to
- -- check for hanging useless assignments from the statement sequence of
- -- the subprogram body. Skip this in the body of a postcondition,
- -- since in that case there are no source references, and we need to
- -- preserve deferred references from the enclosing scope.
+ -- If the current scope is a subprogram, entry or task body or declare
+ -- block then this is the right place to check for hanging useless
+ -- assignments from the statement sequence. Skip this in the body of a
+ -- postcondition, since in that case there are no source references, and
+ -- we need to preserve deferred references from the enclosing scope.
- if Is_Subprogram (Current_Scope)
- and then Chars (Current_Scope) /= Name_uPostconditions
+ if ((Is_Subprogram (Current_Scope) or else Is_Entry (Current_Scope))
+ and then Chars (Current_Scope) /= Name_uPostconditions)
+ or else Ekind_In (Current_Scope, E_Block, E_Task_Type)
then
Warn_On_Useless_Assignments (Current_Scope);
end if;