[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 31 Aug 2011 08:37:37 +0000 (10:37 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 31 Aug 2011 08:37:37 +0000 (10:37 +0200)
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.

From-SVN: r178356

gcc/ada/ChangeLog
gcc/ada/a-cbhase.adb
gcc/ada/a-cborma.adb
gcc/ada/a-chtgbo.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb

index 94af331..06d9091 100644 (file)
@@ -1,3 +1,25 @@
+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,
index 3b85e2e..faef78e 100644 (file)
@@ -1274,7 +1274,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
             -------------
 
             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;
 
index 89ec131..4cc2686 100644 (file)
@@ -773,7 +773,16 @@ package body Ada.Containers.Bounded_Ordered_Maps is
       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;
 
index a425469..a9c0c8a 100644 (file)
@@ -136,15 +136,19 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Operations is
      (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
index d48dcae..4cf739f 100644 (file)
@@ -5748,17 +5748,12 @@ package body Sem_Ch12 is
             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));
 
index 5e41099..c2aa404 100644 (file)
@@ -10155,7 +10155,19 @@ package body Sem_Res is
          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;
 
index 1cbadaa..a63a7bf 100644 (file)
@@ -3701,13 +3701,22 @@ package body Sem_Util is
    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.