Commit edbd98c4 by Arnaud Charlet

[multiple changes]

2014-02-19  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, style.adb, sem_prag.adb, sem_ch13.adb: Minor reformatting
	* a-sequio.adb: Remove useless pragma Extensions_Allowed (no
	longer needed).

2014-02-19  Claire Dross  <dross@adacore.com>

	* a-cfdlli.ads, a-cfhase.ads, a-cforma.ads, a-cfhama.ads,
	a-cforse.ads, a-cofove.ads: Add Iterable aspect to formal containers.

From-SVN: r207900
parent fd9710dc
2014-02-19 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, style.adb, sem_prag.adb, sem_ch13.adb: Minor reformatting
* a-sequio.adb: Remove useless pragma Extensions_Allowed (no
longer needed).
2014-02-19 Claire Dross <dross@adacore.com>
* a-cfdlli.ads, a-cfhase.ads, a-cforma.ads, a-cfhama.ads,
a-cforse.ads, a-cofove.ads: Add Iterable aspect to formal containers.
2014-02-19 Hristian Kirtchev <kirtchev@adacore.com> 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Analyze * sem_ch3.adb (Analyze_Declarations): Analyze
......
...@@ -63,7 +63,11 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is ...@@ -63,7 +63,11 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
pragma Annotate (GNATprove, External_Axiomatization); pragma Annotate (GNATprove, External_Axiomatization);
pragma Pure; pragma Pure;
type List (Capacity : Count_Type) is private; type List (Capacity : Count_Type) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
pragma Preelaborable_Initialization (List); pragma Preelaborable_Initialization (List);
type Cursor is private; type Cursor is private;
......
...@@ -67,7 +67,11 @@ package Ada.Containers.Formal_Hashed_Maps is ...@@ -67,7 +67,11 @@ package Ada.Containers.Formal_Hashed_Maps is
pragma Annotate (GNATprove, External_Axiomatization); pragma Annotate (GNATprove, External_Axiomatization);
pragma Pure; pragma Pure;
type Map (Capacity : Count_Type; Modulus : Hash_Type) is private; type Map (Capacity : Count_Type; Modulus : Hash_Type) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
pragma Preelaborable_Initialization (Map); pragma Preelaborable_Initialization (Map);
type Cursor is private; type Cursor is private;
......
...@@ -69,7 +69,11 @@ package Ada.Containers.Formal_Hashed_Sets is ...@@ -69,7 +69,11 @@ package Ada.Containers.Formal_Hashed_Sets is
pragma Annotate (GNATprove, External_Axiomatization); pragma Annotate (GNATprove, External_Axiomatization);
pragma Pure; pragma Pure;
type Set (Capacity : Count_Type; Modulus : Hash_Type) is private; type Set (Capacity : Count_Type; Modulus : Hash_Type) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
pragma Preelaborable_Initialization (Set); pragma Preelaborable_Initialization (Set);
type Cursor is private; type Cursor is private;
......
...@@ -70,7 +70,11 @@ package Ada.Containers.Formal_Ordered_Maps is ...@@ -70,7 +70,11 @@ package Ada.Containers.Formal_Ordered_Maps is
function Equivalent_Keys (Left, Right : Key_Type) return Boolean; function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
type Map (Capacity : Count_Type) is private; type Map (Capacity : Count_Type) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
pragma Preelaborable_Initialization (Map); pragma Preelaborable_Initialization (Map);
type Cursor is private; type Cursor is private;
......
...@@ -68,7 +68,11 @@ package Ada.Containers.Formal_Ordered_Sets is ...@@ -68,7 +68,11 @@ package Ada.Containers.Formal_Ordered_Sets is
function Equivalent_Elements (Left, Right : Element_Type) return Boolean; function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
type Set (Capacity : Count_Type) is private; type Set (Capacity : Count_Type) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
pragma Preelaborable_Initialization (Set); pragma Preelaborable_Initialization (Set);
type Cursor is private; type Cursor is private;
......
...@@ -75,7 +75,11 @@ package Ada.Containers.Formal_Vectors is ...@@ -75,7 +75,11 @@ package Ada.Containers.Formal_Vectors is
subtype Capacity_Range is subtype Capacity_Range is
Count_Type range 0 .. Count_Type (Index_Type'Last - Index_Type'First + 1); Count_Type range 0 .. Count_Type (Index_Type'Last - Index_Type'First + 1);
type Vector (Capacity : Capacity_Range) is private; type Vector (Capacity : Capacity_Range) is private with
Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Element);
type Cursor is private; type Cursor is private;
pragma Preelaborable_Initialization (Cursor); pragma Preelaborable_Initialization (Cursor);
......
...@@ -202,12 +202,7 @@ package body Ada.Sequential_IO is ...@@ -202,12 +202,7 @@ package body Ada.Sequential_IO is
-- buffer if Item is constrained, to check that the discriminants -- buffer if Item is constrained, to check that the discriminants
-- are correct. -- are correct.
pragma Extensions_Allowed (On); if Element_Type'Has_Discriminants and then Item'Constrained then
-- Needed to allow Constrained reference here
if Element_Type'Has_Discriminants
and then Item'Constrained
then
declare declare
RsizS : constant SSE.Storage_Offset := RsizS : constant SSE.Storage_Offset :=
SSE.Storage_Offset (Rsiz - 1); SSE.Storage_Offset (Rsiz - 1);
......
...@@ -9770,15 +9770,15 @@ package body Sem_Ch13 is ...@@ -9770,15 +9770,15 @@ package body Sem_Ch13 is
Cursor : Entity_Id; Cursor : Entity_Id;
begin begin
-- If error already detected, return. -- If error already detected, return
if Error_Posted (Aspect) then if Error_Posted (Aspect) then
return Any_Type; return Any_Type;
end if; end if;
-- The cursor type for an Iterable aspect is the return type of -- The cursor type for an Iterable aspect is the return type of a
-- a non-overloaded First primitive operation. Locate association -- non-overloaded First primitive operation. Locate association for
-- for First. -- First.
Assoc := First (Component_Associations (Expression (Aspect))); Assoc := First (Component_Associations (Expression (Aspect)));
First_Op := Any_Id; First_Op := Any_Id;
...@@ -9798,7 +9798,7 @@ package body Sem_Ch13 is ...@@ -9798,7 +9798,7 @@ package body Sem_Ch13 is
Cursor := Any_Type; Cursor := Any_Type;
-- Locate function with desired name and profile in scope of type. -- Locate function with desired name and profile in scope of type
Func := First_Entity (Scope (Typ)); Func := First_Entity (Scope (Typ));
while Present (Func) loop while Present (Func) loop
...@@ -11524,7 +11524,7 @@ package body Sem_Ch13 is ...@@ -11524,7 +11524,7 @@ package body Sem_Ch13 is
Element_Id : Entity_Id; Element_Id : Entity_Id;
begin begin
-- If previous error aspect is unusable. -- If previous error aspect is unusable
if Cursor = Any_Type then if Cursor = Any_Type then
return; return;
......
...@@ -4651,8 +4651,7 @@ package body Sem_Prag is ...@@ -4651,8 +4651,7 @@ package body Sem_Prag is
Check_Grouping (Statements (HSS)); Check_Grouping (Statements (HSS));
end if; end if;
-- The first pragma of the first topmost grouping has been -- First pragma of the first topmost grouping has been found
-- found.
elsif Is_Loop_Pragma (Stmt) then elsif Is_Loop_Pragma (Stmt) then
...@@ -4755,6 +4754,7 @@ package body Sem_Prag is ...@@ -4755,6 +4754,7 @@ package body Sem_Prag is
procedure Placement_Error (Constr : Node_Id) is procedure Placement_Error (Constr : Node_Id) is
LA : constant String := " with Loop_Entry"; LA : constant String := " with Loop_Entry";
begin begin
if Prag_Id = Pragma_Assert then if Prag_Id = Pragma_Assert then
Error_Msg_String (1 .. LA'Length) := LA; Error_Msg_String (1 .. LA'Length) := LA;
......
...@@ -260,8 +260,8 @@ package body Style is ...@@ -260,8 +260,8 @@ package body Style is
procedure Missing_Overriding (N : Node_Id; E : Entity_Id) is procedure Missing_Overriding (N : Node_Id; E : Entity_Id) is
Nod : Node_Id; Nod : Node_Id;
begin
begin
-- Perform the check on source subprograms and on subprogram instances, -- Perform the check on source subprograms and on subprogram instances,
-- because these can be primitives of untagged types. Note that such -- because these can be primitives of untagged types. Note that such
-- indicators were introduced in Ada 2005. -- indicators were introduced in Ada 2005.
...@@ -278,7 +278,6 @@ package body Style is ...@@ -278,7 +278,6 @@ package body Style is
and then Is_Generic_Instance (E) and then Is_Generic_Instance (E)
then then
Nod := Next (Parent (Parent (List_Containing (N)))); Nod := Next (Parent (Parent (List_Containing (N))));
else else
Nod := N; Nod := N;
end if; end if;
......
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