+2011-08-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch12 (Check_Private_View): Revert previous change.
+ * sem_res.adb (Conversion_Check): Do not emit the error message if the
+ conversion is in a generic instance.
+
+2011-08-31 Matthew Heaney <heaney@adacore.com>
+
+ * a-cbhase.adb (Symmetric_Difference): Dereference correct node array.
+ * a-chtgbo.adb (Free): Allow 0 as index value.
+
+2011-08-31 Matthew Heaney <heaney@adacore.com>
+
+ * a-cborma.adb (Insert): Add comment to explain why no element
+ assignment.
+
+2011-08-31 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_util.adb (Find_Body_Discriminal): Test whether the scope of the
+ spec discriminant is already a concurrent type, in which case just use
+ it, otherwise fetch the Corresponding_Concurrent_Type as before.
+
2011-08-30 Eric Botcazou <ebotcazou@adacore.com>
* system-irix-n64.ads, system-linux-armeb.ads, system-linux-armel.ads,
-------------
procedure Process (R_Node : Count_Type) is
- N : Node_Type renames Left.Nodes (R_Node);
+ N : Node_Type renames Right.Nodes (R_Node);
X : Count_Type;
B : Boolean;
begin
Node.Key := Key;
- -- Why is the following commented out ???
+ -- Were this insertion operation to accept an element parameter, this
+ -- is the point where the element value would be used, to update the
+ -- element component of the new node. However, this insertion
+ -- operation is special, in the sense that it does not accept an
+ -- element parameter. Rather, this version of Insert allocates a node
+ -- (inserting it among the active nodes of the container in the
+ -- normal way, with the node's position being determined by the Key),
+ -- and passes back a cursor designating the node. It is then up to
+ -- the caller to assign a value to the node's element.
+
-- Node.Element := New_Item;
end Assign;
(HT : in out Hash_Table_Type'Class;
X : Count_Type)
is
- pragma Assert (X > 0);
+ N : Nodes_Type renames HT.Nodes;
+
+ begin
+ if X = 0 then
+ return;
+ end if;
+
pragma Assert (X <= HT.Capacity);
- N : Nodes_Type renames HT.Nodes;
-- pragma Assert (N (X).Prev >= 0); -- node is active
-- Find a way to mark a node as active vs. inactive; we could
-- use a special value in Color_Type for this. ???
- begin
-- The hash table actually contains two data structures: a list for
-- the "active" nodes that contain elements that have been inserted
-- onto the container, and another for the "inactive" nodes of the free
end if;
-- For composite types with inconsistent representation exchange
- -- component types accordingly. We exchange the private and full view
- -- of a designated type when the related access type is an actual in
- -- an instance. This ensures that the full view of designated type is
- -- available when inside the body of the instance.
- -- Is this right ???
+ -- component types accordingly.
elsif Is_Access_Type (T)
and then Is_Private_Type (Designated_Type (T))
and then not Has_Private_View (N)
and then Present (Full_View (Designated_Type (T)))
- and then Used_As_Generic_Actual (T)
then
Switch_View (Designated_Type (T));
Msg : String) return Boolean
is
begin
- if not Valid then
+ if not Valid
+
+ -- A generic unit has already been analyzed and we have verified
+ -- that a particular conversion is OK in that context. Since the
+ -- instance is reanalyzed without relying on the relationships
+ -- established during the analysis of the generic, it is possible
+ -- to end up with inconsistent views of private types. Do not emit
+ -- the error message in such cases. The rest of the machinery in
+ -- Valid_Conversion still ensures the proper compatibility of
+ -- target and operand types.
+
+ and then not In_Instance
+ then
Error_Msg_N (Msg, Operand);
end if;
function Find_Body_Discriminal
(Spec_Discriminant : Entity_Id) return Entity_Id
is
- pragma Assert (Is_Concurrent_Record_Type (Scope (Spec_Discriminant)));
-
- Tsk : constant Entity_Id :=
- Corresponding_Concurrent_Type (Scope (Spec_Discriminant));
+ Tsk : Entity_Id;
Disc : Entity_Id;
begin
+ -- If expansion is suppressed, then the scope can be the concurrent type
+ -- itself rather than a corresponding concurrent record type.
+
+ if Is_Concurrent_Type (Scope (Spec_Discriminant)) then
+ Tsk := Scope (Spec_Discriminant);
+
+ else
+ pragma Assert (Is_Concurrent_Record_Type (Scope (Spec_Discriminant)));
+
+ Tsk := Corresponding_Concurrent_Type (Scope (Spec_Discriminant));
+ end if;
+
-- Find discriminant of original concurrent type, and use its current
-- discriminal, which is the renaming within the task/protected body.