OSDN Git Service

2007-08-16 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Aug 2007 12:20:50 +0000 (12:20 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Aug 2007 12:20:50 +0000 (12:20 +0000)
* sem_disp.adb (Check_Dispatching_Operation): If the operation
implements an operation inherited from a progenitor interface, verify
that they are subtype-conformant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127549 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/sem_disp.adb

index e0f384a..faf9740 100644 (file)
@@ -1333,8 +1333,10 @@ package body Sem_Disp is
       then
          --  Ada 2005 (AI-251): Update the attribute alias of all the aliased
          --  entities of the overridden primitive to reference New_Op, and also
-         --  propagate them the new value of the attribute
-         --  Is_Abstract_Subprogram.
+         --  propagate the proper value of Is_Abstract_Subprogram. Verify
+         --  that the new operation is subtype conformant with the interface
+         --  operations that it implements (for operations inherited from the
+         --  parent itself, this check is made when building the derived type).
 
          Elmt := First_Elmt (Primitive_Operations (Tagged_Type));
          while Present (Elmt) loop
@@ -1351,6 +1353,7 @@ package body Sem_Disp is
               and then Alias (Prim) = Prev_Op
             then
                Set_Alias (Prim, New_Op);
+               Check_Subtype_Conformant (New_Op, Prim);
                Set_Is_Abstract_Subprogram
                  (Prim, Is_Abstract_Subprogram (New_Op));