aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_disp.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-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 8d779b2..9f80a7d 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -44,6 +44,7 @@ with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch6; use Sem_Ch6;
+with Sem_Ch8; use Sem_Ch8;
with Sem_Eval; use Sem_Eval;
with Sem_Type; use Sem_Type;
with Sem_Util; use Sem_Util;
@@ -1867,12 +1868,14 @@ package body Sem_Disp is
Vis_List : Elist_Id;
begin
- -- This Ada 2012 rule is valid only for type extensions or private
- -- extensions.
+ -- This Ada 2012 rule applies only for type extensions or private
+ -- extensions, where the parent type is not in a parent unit, and
+ -- where an operation is never declared but still inherited.
if No (Tag_Typ)
or else not Is_Record_Type (Tag_Typ)
or else Etype (Tag_Typ) = Tag_Typ
+ or else In_Open_Scopes (Scope (Etype (Tag_Typ)))
then
return Empty;
end if;