aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb38
1 files changed, 26 insertions, 12 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 56dc7c6..018c8a0 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -5603,6 +5603,10 @@ package body Sem_Ch4 is
if No (Act_Decl) then
Set_Etype (N, Etype (Comp));
+ if Is_Mutably_Tagged_CW_Equivalent_Type (Etype (N)) then
+ Make_Mutably_Tagged_Conversion (N);
+ end if;
+
else
-- If discriminants were present in the component
-- declaration, they have been replaced by the
@@ -10406,11 +10410,14 @@ package body Sem_Ch4 is
-- may be candidates, so that Try_Primitive_Operations can examine
-- them if no real primitive is found.
- function Is_Private_Overriding (Op : Entity_Id) return Boolean;
+ function Is_Callable_Private_Overriding
+ (Op : Entity_Id) return Boolean;
-- An operation that overrides an inherited operation in the private
-- part of its package may be hidden, but if the inherited operation
- -- is visible a direct call to it will dispatch to the private one,
- -- which is therefore a valid candidate.
+ -- that it overrides is visible, then a direct call to it will
+ -- dispatch to the private one, which is therefore a valid candidate.
+ -- Returns True if the operation can be called from outside the
+ -- enclosing package.
function Names_Match
(Obj_Type : Entity_Id;
@@ -10581,11 +10588,13 @@ package body Sem_Ch4 is
return Op_List;
end Extended_Primitive_Ops;
- ---------------------------
- -- Is_Private_Overriding --
- ---------------------------
+ ------------------------------------
+ -- Is_Callable_Private_Overriding --
+ ------------------------------------
- function Is_Private_Overriding (Op : Entity_Id) return Boolean is
+ function Is_Callable_Private_Overriding
+ (Op : Entity_Id) return Boolean
+ is
Visible_Op : Entity_Id;
begin
@@ -10607,7 +10616,10 @@ package body Sem_Ch4 is
-- have found what we're looking for.
if not Is_Hidden (Visible_Op)
- or else not Is_Hidden (Overridden_Operation (Op))
+ or else
+ (Present (Overridden_Inherited_Operation (Op))
+ and then not Is_Hidden
+ (Overridden_Inherited_Operation (Op)))
then
return True;
end if;
@@ -10617,7 +10629,7 @@ package body Sem_Ch4 is
end loop;
return False;
- end Is_Private_Overriding;
+ end Is_Callable_Private_Overriding;
-----------------
-- Names_Match --
@@ -10760,13 +10772,15 @@ package body Sem_Ch4 is
-- Do not consider hidden primitives unless the type is in an
-- open scope or we are within an instance, where visibility
- -- is known to be correct, or else if this is an overriding
- -- operation in the private part for an inherited operation.
+ -- is known to be correct, or else if this is an operation
+ -- declared in the private part that overrides a visible
+ -- inherited operation.
or else (Is_Hidden (Prim_Op)
and then not Is_Immediately_Visible (Obj_Type)
and then not In_Instance
- and then not Is_Private_Overriding (Prim_Op))
+ and then
+ not Is_Callable_Private_Overriding (Prim_Op))
then
goto Continue;
end if;