aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2007-08-16 14:20:50 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-08-16 14:20:50 +0200
commitace980d5d8b6443b4e0d8d5b9cdcd34083c5e09b (patch)
tree9395db24ad0942b3866ac6ef30de0f3c9fd70cf2 /gcc/ada
parent3b8b72709570294dbf39a767446abe0bdf17c40f (diff)
downloadgcc-ace980d5d8b6443b4e0d8d5b9cdcd34083c5e09b.zip
gcc-ace980d5d8b6443b4e0d8d5b9cdcd34083c5e09b.tar.gz
gcc-ace980d5d8b6443b4e0d8d5b9cdcd34083c5e09b.tar.bz2
sem_disp.adb (Check_Dispatching_Operation): If the operation implements an operation inherited from a progenitor interface...
2007-08-16 Ed Schonberg <schonberg@adacore.com> * sem_disp.adb (Check_Dispatching_Operation): If the operation implements an operation inherited from a progenitor interface, verify that they are subtype-conformant. From-SVN: r127549
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_disp.adb7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index e0f384a..faf9740 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -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));