[multiple changes]

2010-10-07  Thomas Quinot  <quinot@adacore.com>

	* sem_res.adb: Minor reformatting.

2010-10-07  Arnaud Charlet  <charlet@adacore.com>

	* debug.adb: Update -gnatd.J documentation.

2010-10-07  Robert Dewar  <dewar@adacore.com>

	* gnat_rm.texi: Document handling of invalid values
	* s-utf_32.ads, s-utf_32.adb (UTF_To_Lower_Case): Fix implementation
	to match new spec.
	(UTF_To_Upper_Case): New function.

From-SVN: r165083
This commit is contained in:
Arnaud Charlet 2010-10-07 11:16:06 +02:00
parent 599a741170
commit b4a4936bdc
6 changed files with 1204 additions and 112 deletions

View file

@ -1,3 +1,18 @@
2010-10-07 Thomas Quinot <quinot@adacore.com>
* sem_res.adb: Minor reformatting.
2010-10-07 Arnaud Charlet <charlet@adacore.com>
* debug.adb: Update -gnatd.J documentation.
2010-10-07 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document handling of invalid values
* s-utf_32.ads, s-utf_32.adb (UTF_To_Lower_Case): Fix implementation
to match new spec.
(UTF_To_Upper_Case): New function.
2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_attr.adb: Minor reformatting.

View file

@ -127,7 +127,7 @@ package body Debug is
-- d.G
-- d.H
-- d.I SCIL generation mode
-- d.J Parallel SCIL generation mode
-- d.J Disable parallel SCIL generation mode
-- d.K
-- d.L Depend on back end for limited types in conditional expressions
-- d.M
@ -563,9 +563,9 @@ package body Debug is
-- of static analysis tools, and ensure additional tree consistency
-- between different compilations of specs.
-- d.J Ensure the SCIL generated is compatible with parallel builds.
-- This means in particular not writing the same files under the
-- same directory.
-- d.J Disable parallel SCIL generation. Normally SCIL file generation is
-- done in parallel to speed processing. This switch disables this
-- behavior.
-- d.L Normally the front end generates special expansion for conditional
-- expressions of a limited type. This debug flag removes this special

View file

@ -7912,10 +7912,11 @@ Followed.
@chapter Implementation Defined Characteristics
@noindent
In addition to the implementation dependent pragmas and attributes, and
the implementation advice, there are a number of other Ada features
that are potentially implementation dependent. These are mentioned
throughout the Ada Reference Manual, and are summarized in Annex M@.
In addition to the implementation dependent pragmas and attributes, and the
implementation advice, there are a number of other Ada features that are
potentially implementation dependent and are designated as
implementation-defined. These are mentioned throughout the Ada Reference
Manual, and are summarized in Annex M@.
A requirement for conforming Ada compilers is that they provide
documentation describing how the implementation deals with each of these
@ -8528,6 +8529,35 @@ unconstrained array are not permitted. If the target alignment is
greater than the source alignment, then a copy of the result is
made with appropriate alignment
@sp 1
@cartouche
@noindent
@strong{53}. The semantics of operations on invalid representations.
See 13.9.2(10-11).
@end cartouche
@noindent
For assignments and other operations where the use of invalid values cannot
result in erroneous behavior, the compiler ignores the possibility of invalid
values. An exception is raised at the point where an invalid value would
result in erroneous behavior. For example executing:
@smallexample @c ada
procedure invalidvals is
X : Integer := -1;
Y : Natural range 1 .. 10;
for Y'Address use X'Address;
Z : Natural range 1 .. 10;
A : array (Natural range 1 .. 10) of Integer;
begin
Z := Y; -- no exception
A (Z) := 3; -- exception raised;
end;
@end smallexample
@noindent
As indicated, an exception is raised on the array assignment, but not
on the simple assignment of the invalid negative value from Y to Z.
@sp 1
@cartouche
@noindent

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2005-2009, Free Software Foundation, Inc. --
-- Copyright (C) 2005-2010, 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- --
@ -185,13 +185,27 @@ package System.UTF_32 is
-- The following function is used to fold to upper case, as required by
-- the Ada 2005 standard rules for identifier case folding. Two
-- identifiers are equivalent if they are identical after folding all
-- letters to upper case using this routine.
-- letters to upper case using this routine. A corresponding routine to
-- fold to lower case is also provided.
function UTF_32_To_Lower_Case (U : UTF_32) return UTF_32;
pragma Inline (UTF_32_To_Lower_Case);
-- If U represents an upper case letter, returns the corresponding lower
-- case letter, otherwise U is returned unchanged. The folding rule is
-- simply that if the code corresponds to a 10646 entry whose name contains
-- the string CAPITAL LETTER, and there is a corresponding entry whose name
-- is the same but with CAPITAL LETTER replaced by SMALL LETTER, then the
-- code is folded to this SMALL LETTER code. Otherwise the input code is
-- returned unchanged.
function UTF_32_To_Upper_Case (U : UTF_32) return UTF_32;
pragma Inline (UTF_32_To_Upper_Case);
-- If U represents a lower case letter, returns the corresponding upper
-- case letter, otherwise U is returned unchanged. The folding is locale
-- independent as defined by documents referenced in the note in section
-- 1 of ISO/IEC 10646:2003
-- If U represents a lower case letter, returns the corresponding lower
-- case letter, otherwise U is returned unchanged. The folding rule is
-- simply that if the code corresponds to a 10646 entry whose name contains
-- the string SMALL LETTER, and there is a corresponding entry whose name
-- is the same but with SMALL LETTER replaced by CAPITAL LETTER, then the
-- code is folded to this CAPITAL LETTER code. Otherwise the input code is
-- returned unchanged.
end System.UTF_32;

View file

@ -1012,7 +1012,7 @@ package body Sem_Res is
begin
-- If the context is an attribute reference that can apply to
-- functions, this is never a parameterless call (RM 4.1.4 (6)).
-- functions, this is never a parameterless call (RM 4.1.4(6)).
if Nkind (Parent (N)) = N_Attribute_Reference
and then (Attribute_Name (Parent (N)) = Name_Address
@ -1150,7 +1150,7 @@ package body Sem_Res is
begin
return Ekind (Btyp) = E_Access_Type
or else (Ekind (Btyp) = E_Access_Subprogram_Type
and then Comes_From_Source (Btyp));
and then Comes_From_Source (Btyp));
end Is_Definite_Access_Type;
----------------------
@ -1199,13 +1199,13 @@ package body Sem_Res is
type Kind_Test is access function (E : Entity_Id) return Boolean;
function Operand_Type_In_Scope (S : Entity_Id) return Boolean;
-- If the operand is not universal, and the operator is given by a
-- expanded name, verify that the operand has an interpretation with
-- a type defined in the given scope of the operator.
-- If the operand is not universal, and the operator is given by an
-- expanded name, verify that the operand has an interpretation with a
-- type defined in the given scope of the operator.
function Type_In_P (Test : Kind_Test) return Entity_Id;
-- Find a type of the given class in the package Pack that contains
-- the operator.
-- Find a type of the given class in package Pack that contains the
-- operator.
---------------------------
-- Operand_Type_In_Scope --
@ -1280,12 +1280,10 @@ package body Sem_Res is
-- Start of processing for Type_In_P
begin
-- If the context type is declared in the prefix package, this
-- is the desired base type.
-- If the context type is declared in the prefix package, this is the
-- desired base type.
if Scope (Base_Type (Typ)) = Pack
and then Test (Typ)
then
if Scope (Base_Type (Typ)) = Pack and then Test (Typ) then
return Base_Type (Typ);
else
@ -1343,7 +1341,7 @@ package body Sem_Res is
-- A final wrinkle is the multiplication operator for fixed point types,
-- which is defined in Standard only, and not in the scope of the
-- fixed_point type itself.
-- fixed point type itself.
if Nkind (Name (N)) = N_Expanded_Name then
Pack := Entity (Prefix (Name (N)));
@ -1371,7 +1369,7 @@ package body Sem_Res is
Error := True;
end if;
-- Ada 2005, AI-420: Predefined equality on Universal_Access is
-- Ada 2005 AI-420: Predefined equality on Universal_Access is
-- available.
elsif Ada_Version >= Ada_05