aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-06-11 14:50:22 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-06-11 14:50:22 +0200
commit3e65bfab4abd298b77ed3a91b13ac6bb5c5305bd (patch)
tree310e3b9e3509ccd53bfff9c5037d80d9a745ba8e /gcc/ada/checks.adb
parent0d305ef00438e2a7d3f225d5ff177de43f8514a6 (diff)
downloadgcc-3e65bfab4abd298b77ed3a91b13ac6bb5c5305bd.zip
gcc-3e65bfab4abd298b77ed3a91b13ac6bb5c5305bd.tar.gz
gcc-3e65bfab4abd298b77ed3a91b13ac6bb5c5305bd.tar.bz2
[multiple changes]
2014-06-11 Thomas Quinot <quinot@adacore.com> * freeze.ads: Minor reformatting. * checks.adb (Determine_Range): Do not attempt to determine the range of a deferred constant whose full view has not been seen yet. * sem_res.adb (Resolve): Remove undesirable guard against resolving expressions from expression functions. 2014-06-11 Robert Dewar <dewar@adacore.com> * debug.adb (Debug_Flag_Dot_1): Set to enable fix for anonymous access types. * layout.adb (Layout_Type): Make anonymous access types for subprogram formal types and return types always thin. For now only enabled if -gnatd.1 set. 2014-06-11 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Stream_TSS_Definition): Apply legality rule for stream attributes of interface types (RM 13.13.2 (38/3)): subprogram must be a null procedure. From-SVN: r211464
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb31
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 32f0249..7ec8599 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -4118,26 +4118,37 @@ package body Checks is
-- Start of processing for Determine_Range
begin
+ -- Prevent junk warnings by initializing range variables
+
+ Lo := No_Uint;
+ Hi := No_Uint;
+ Lor := No_Uint;
+ Hir := No_Uint;
+
-- For temporary constants internally generated to remove side effects
-- we must use the corresponding expression to determine the range of
- -- the expression.
+ -- the expression. But note that the expander can also generate
+ -- constants in other cases, including deferred constants.
if Is_Entity_Name (N)
and then Nkind (Parent (Entity (N))) = N_Object_Declaration
and then Ekind (Entity (N)) = E_Constant
and then Is_Internal_Name (Chars (Entity (N)))
then
- Determine_Range
- (Expression (Parent (Entity (N))), OK, Lo, Hi, Assume_Valid);
- return;
- end if;
+ if Present (Expression (Parent (Entity (N)))) then
+ Determine_Range
+ (Expression (Parent (Entity (N))), OK, Lo, Hi, Assume_Valid);
- -- Prevent junk warnings by initializing range variables
+ elsif Present (Full_View (Entity (N))) then
+ Determine_Range
+ (Expression (Parent (Full_View (Entity (N)))),
+ OK, Lo, Hi, Assume_Valid);
- Lo := No_Uint;
- Hi := No_Uint;
- Lor := No_Uint;
- Hir := No_Uint;
+ else
+ OK := False;
+ end if;
+ return;
+ end if;
-- If type is not defined, we can't determine its range