+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.
-- --
-- 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- --
-- 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
-- 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
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