summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aggr.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r--gcc/ada/sem_aggr.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index f930ecbf14c..5c7d9bd7dda 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -2159,7 +2159,9 @@ package body Sem_Aggr is
Imm_Type := Etype (Base_Type (Imm_Type));
end loop;
- if Etype (Imm_Type) /= Base_Type (A_Type) then
+ if Etype (Imm_Type) /= Base_Type (A_Type)
+ or else Base_Type (Typ) = Base_Type (A_Type)
+ then
Error_Msg_NE ("expect ancestor type of &", A, Typ);
return False;
else