diff options
author | Robert Dewar <dewar@adacore.com> | 2015-01-30 15:23:22 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-01-30 16:23:22 +0100 |
commit | b7db11490f4928d6e15c7e2310e65b53225f0f21 (patch) | |
tree | 4eb1670355e4d3c2c0879b68808e2f1817a2d85e /gcc | |
parent | 1db700c32b598f2b8cead592036713cbc69c8058 (diff) | |
download | gcc-b7db11490f4928d6e15c7e2310e65b53225f0f21.zip gcc-b7db11490f4928d6e15c7e2310e65b53225f0f21.tar.gz gcc-b7db11490f4928d6e15c7e2310e65b53225f0f21.tar.bz2 |
sem_prag.adb (Process_Import_Or_Interface): Warn if used in Pure unit.
2015-01-30 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Process_Import_Or_Interface): Warn if used in
Pure unit.
* s-valllu.ads (Scan_Raw_Long_Long_Unsigned): Clarify
documentation for some special cases of invalid attempts at
based integers.
From-SVN: r220287
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/s-valllu.ads | 31 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 4 |
3 files changed, 36 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8829a1f..f9cbac4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2015-01-30 Robert Dewar <dewar@adacore.com> + + * sem_prag.adb (Process_Import_Or_Interface): Warn if used in + Pure unit. + * s-valllu.ads (Scan_Raw_Long_Long_Unsigned): Clarify + documentation for some special cases of invalid attempts at + based integers. + 2015-01-30 Gary Dismukes <dismukes@adacore.com> * errout.ads: Minor reformatting. diff --git a/gcc/ada/s-valllu.ads b/gcc/ada/s-valllu.ads index 993ea8b..612004a 100644 --- a/gcc/ada/s-valllu.ads +++ b/gcc/ada/s-valllu.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, 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- -- @@ -65,13 +65,32 @@ package System.Val_LLU is -- seem to imply that for a case like -- -- 8#12345670009# - + -- -- the pointer should be left at the first # having scanned out the longest -- valid integer literal (8), but in fact in this case the pointer points - -- to the invalid based digit (9 in this case). Not only would the strict - -- reading of the RM require unlimited backup, which is unreasonable, but - -- in addition, the intepretation as given here is the one expected and - -- enforced by the ACATS tests. + -- past the final # and Constraint_Error is raised. This is the behavior + -- expected for Text_IO and enforced by the ACATS tests. + -- + -- If a based literal is malformed in that a character other than a valid + -- hexadecimal digit is encountered during scanning out the digits after + -- the # (this includes the case of using the wrong terminator, : instead + -- of # or vice versa) there are two cases. If all the digits before the + -- non-digit are in range of the base, as in + -- + -- 8#100x00# + -- 8#100: + -- + -- then in this case, the "base" value before the initial # is returned as + -- the result, and the pointer points to the initial # character on return. + -- + -- If an out of range digit has been detected before the invalid character, + -- as in: + -- + -- 8#900x00# + -- 8#900: + -- + -- then the pointer is also left at the initial # character, but constraint + -- error is raised reflecting the encounter of an out of range digit. -- -- Note: if Str is empty, i.e. if Max is less than Ptr, then this is a -- special case of an all-blank string, and Ptr is unchanged, and hence diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 4a3bb21..bd236e5 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3169,7 +3169,7 @@ package body Sem_Prag is -- Common processing for Share_Generic and Inline_Generic procedure Process_Import_Or_Interface; - -- Common processing for Import of Interface + -- Common processing for Import or Interface procedure Process_Import_Predefined_Type; -- Processing for completing a type with pragma Import. This is used @@ -7742,6 +7742,8 @@ package body Sem_Prag is Note_Possible_Modification (Get_Pragma_Arg (Arg2), Sure => False); end if; + -- Various error checks + if Ekind_In (Def_Id, E_Variable, E_Constant) then -- We do not permit Import to apply to a renaming declaration |