Commit b4a4936b by Arnaud Charlet

[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
parent 599a7411
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> 2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_attr.adb: Minor reformatting. * sem_attr.adb: Minor reformatting.
......
...@@ -127,7 +127,7 @@ package body Debug is ...@@ -127,7 +127,7 @@ package body Debug is
-- d.G -- d.G
-- d.H -- d.H
-- d.I SCIL generation mode -- d.I SCIL generation mode
-- d.J Parallel SCIL generation mode -- d.J Disable parallel SCIL generation mode
-- d.K -- d.K
-- d.L Depend on back end for limited types in conditional expressions -- d.L Depend on back end for limited types in conditional expressions
-- d.M -- d.M
...@@ -563,9 +563,9 @@ package body Debug is ...@@ -563,9 +563,9 @@ package body Debug is
-- of static analysis tools, and ensure additional tree consistency -- of static analysis tools, and ensure additional tree consistency
-- between different compilations of specs. -- between different compilations of specs.
-- d.J Ensure the SCIL generated is compatible with parallel builds. -- d.J Disable parallel SCIL generation. Normally SCIL file generation is
-- This means in particular not writing the same files under the -- done in parallel to speed processing. This switch disables this
-- same directory. -- behavior.
-- d.L Normally the front end generates special expansion for conditional -- d.L Normally the front end generates special expansion for conditional
-- expressions of a limited type. This debug flag removes this special -- expressions of a limited type. This debug flag removes this special
......
...@@ -7912,10 +7912,11 @@ Followed. ...@@ -7912,10 +7912,11 @@ Followed.
@chapter Implementation Defined Characteristics @chapter Implementation Defined Characteristics
@noindent @noindent
In addition to the implementation dependent pragmas and attributes, and In addition to the implementation dependent pragmas and attributes, and the
the implementation advice, there are a number of other Ada features implementation advice, there are a number of other Ada features that are
that are potentially implementation dependent. These are mentioned potentially implementation dependent and are designated as
throughout the Ada Reference Manual, and are summarized in Annex M@. 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 A requirement for conforming Ada compilers is that they provide
documentation describing how the implementation deals with each of these documentation describing how the implementation deals with each of these
...@@ -8531,6 +8532,35 @@ made with appropriate alignment ...@@ -8531,6 +8532,35 @@ made with appropriate alignment
@sp 1 @sp 1
@cartouche @cartouche
@noindent @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
@strong{53}. The manner of choosing a storage pool for an access type @strong{53}. The manner of choosing a storage pool for an access type
when @code{Storage_Pool} is not specified for the type. See 13.11(17). when @code{Storage_Pool} is not specified for the type. See 13.11(17).
@end cartouche @end cartouche
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -185,13 +185,27 @@ package System.UTF_32 is ...@@ -185,13 +185,27 @@ package System.UTF_32 is
-- The following function is used to fold to upper case, as required by -- The following function is used to fold to upper case, as required by
-- the Ada 2005 standard rules for identifier case folding. Two -- the Ada 2005 standard rules for identifier case folding. Two
-- identifiers are equivalent if they are identical after folding all -- 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; function UTF_32_To_Upper_Case (U : UTF_32) return UTF_32;
pragma Inline (UTF_32_To_Upper_Case); pragma Inline (UTF_32_To_Upper_Case);
-- If U represents a lower case letter, returns the corresponding upper -- If U represents a lower case letter, returns the corresponding lower
-- case letter, otherwise U is returned unchanged. The folding is locale -- case letter, otherwise U is returned unchanged. The folding rule is
-- independent as defined by documents referenced in the note in section -- simply that if the code corresponds to a 10646 entry whose name contains
-- 1 of ISO/IEC 10646:2003 -- 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; end System.UTF_32;
...@@ -1012,7 +1012,7 @@ package body Sem_Res is ...@@ -1012,7 +1012,7 @@ package body Sem_Res is
begin begin
-- If the context is an attribute reference that can apply to -- 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 if Nkind (Parent (N)) = N_Attribute_Reference
and then (Attribute_Name (Parent (N)) = Name_Address and then (Attribute_Name (Parent (N)) = Name_Address
...@@ -1199,13 +1199,13 @@ package body Sem_Res is ...@@ -1199,13 +1199,13 @@ package body Sem_Res is
type Kind_Test is access function (E : Entity_Id) return Boolean; type Kind_Test is access function (E : Entity_Id) return Boolean;
function Operand_Type_In_Scope (S : 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 -- If the operand is not universal, and the operator is given by an
-- expanded name, verify that the operand has an interpretation with -- expanded name, verify that the operand has an interpretation with a
-- a type defined in the given scope of the operator. -- type defined in the given scope of the operator.
function Type_In_P (Test : Kind_Test) return Entity_Id; function Type_In_P (Test : Kind_Test) return Entity_Id;
-- Find a type of the given class in the package Pack that contains -- Find a type of the given class in package Pack that contains the
-- the operator. -- operator.
--------------------------- ---------------------------
-- Operand_Type_In_Scope -- -- Operand_Type_In_Scope --
...@@ -1280,12 +1280,10 @@ package body Sem_Res is ...@@ -1280,12 +1280,10 @@ package body Sem_Res is
-- Start of processing for Type_In_P -- Start of processing for Type_In_P
begin begin
-- If the context type is declared in the prefix package, this -- If the context type is declared in the prefix package, this is the
-- is the desired base type. -- desired base type.
if Scope (Base_Type (Typ)) = Pack if Scope (Base_Type (Typ)) = Pack and then Test (Typ) then
and then Test (Typ)
then
return Base_Type (Typ); return Base_Type (Typ);
else else
...@@ -1343,7 +1341,7 @@ package body Sem_Res is ...@@ -1343,7 +1341,7 @@ package body Sem_Res is
-- A final wrinkle is the multiplication operator for fixed point types, -- A final wrinkle is the multiplication operator for fixed point types,
-- which is defined in Standard only, and not in the scope of the -- 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 if Nkind (Name (N)) = N_Expanded_Name then
Pack := Entity (Prefix (Name (N))); Pack := Entity (Prefix (Name (N)));
...@@ -1371,7 +1369,7 @@ package body Sem_Res is ...@@ -1371,7 +1369,7 @@ package body Sem_Res is
Error := True; Error := True;
end if; end if;
-- Ada 2005, AI-420: Predefined equality on Universal_Access is -- Ada 2005 AI-420: Predefined equality on Universal_Access is
-- available. -- available.
elsif Ada_Version >= Ada_05 elsif Ada_Version >= Ada_05
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment