+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>
* sem_ch3.adb (Analyze_Declarations): Analyze
pragma Annotate (GNATprove, External_Axiomatization);
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);
type Cursor is private;
pragma Annotate (GNATprove, External_Axiomatization);
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);
type Cursor is private;
pragma Annotate (GNATprove, External_Axiomatization);
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);
type Cursor is private;
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);
type Cursor is private;
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);
type Cursor is private;
subtype Capacity_Range is
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;
pragma Preelaborable_Initialization (Cursor);
-- buffer if Item is constrained, to check that the discriminants
-- are correct.
- pragma Extensions_Allowed (On);
- -- Needed to allow Constrained reference here
-
- if Element_Type'Has_Discriminants
- and then Item'Constrained
- then
+ if Element_Type'Has_Discriminants and then Item'Constrained then
declare
RsizS : constant SSE.Storage_Offset :=
- SSE.Storage_Offset (Rsiz - 1);
+ SSE.Storage_Offset (Rsiz - 1);
type SA is new SSE.Storage_Array (0 .. RsizS);
function Get_Cursor_Type
(Aspect : Node_Id;
- Typ : Entity_Id) return Entity_Id;
+ Typ : Entity_Id) return Entity_Id;
-- Find Cursor type in scope of Typ, by locating primitive operation First.
-- For use in resolving the other primitive operations of an Iterable type.
Cursor : Entity_Id;
begin
- -- If error already detected, return.
+ -- If error already detected, return
if Error_Posted (Aspect) then
return Any_Type;
end if;
- -- The cursor type for an Iterable aspect is the return type of
- -- a non-overloaded First primitive operation. Locate association
- -- for First.
+ -- The cursor type for an Iterable aspect is the return type of a
+ -- non-overloaded First primitive operation. Locate association for
+ -- First.
Assoc := First (Component_Associations (Expression (Aspect)));
First_Op := Any_Id;
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));
while Present (Func) loop
then
if Cursor /= Any_Type then
Error_Msg_N
- ("Operation First for iterable type must be unique", Aspect);
+ ("Operation First for iterable type must be unique", Aspect);
return Any_Type;
else
if Cursor = Any_Type then
Error_Msg_N
- ("No legal primitive operation First for Iterable type", Aspect);
+ ("No legal primitive operation First for Iterable type", Aspect);
end if;
return Cursor;
Element_Id : Entity_Id;
begin
- -- If previous error aspect is unusable.
+ -- If previous error aspect is unusable
if Cursor = Any_Type then
return;
Error_Msg_Name_1 := Impl_Kind;
Error_Msg_N
("overriding operation& must have synchronization%",
- Subp_Alias);
+ Subp_Alias);
end if;
-- If primitive has Optional synchronization, overriding operation
Error_Msg_Name_1 := Impl_Kind;
Error_Msg_N
("overriding operation& must have syncrhonization%",
- Subp_Alias);
+ Subp_Alias);
end if;
end Check_Pragma_Implemented;
Check_Grouping (Statements (HSS));
end if;
- -- The first pragma of the first topmost grouping has been
- -- found.
+ -- First pragma of the first topmost grouping has been found
elsif Is_Loop_Pragma (Stmt) then
procedure Placement_Error (Constr : Node_Id) is
LA : constant String := " with Loop_Entry";
+
begin
if Prag_Id = Pragma_Assert then
Error_Msg_String (1 .. LA'Length) := LA;
procedure Missing_Overriding (N : Node_Id; E : Entity_Id) is
Nod : Node_Id;
- begin
+ begin
-- Perform the check on source subprograms and on subprogram instances,
-- because these can be primitives of untagged types. Note that such
-- indicators were introduced in Ada 2005.
and then Is_Generic_Instance (E)
then
Nod := Next (Parent (Parent (List_Containing (N))));
-
else
Nod := N;
end if;