summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aggr.adb
diff options
context:
space:
mode:
authorsam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-13 18:15:20 +0000
committersam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-13 18:15:20 +0000
commit5207e7191fb89a5bc8f1a710d6a0be83bfb890ca (patch)
treec4b975b66545fd016e2b72fc1d429e06e87136df /gcc/ada/sem_aggr.adb
parentc2f0327042399b100d792f828204e32afe4b78a4 (diff)
downloadgcc-5207e7191fb89a5bc8f1a710d6a0be83bfb890ca.tar.gz
gcc/ada/
PR ada/17985 * sem_aggr.adb (Valid_Ancestor_Type): A type is not an ancestor of itself. gcc/testsuite/ PR ada/17985 * gnat.dg/ancestor_type.ads, gnat.dg/ancestor_type.adb: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134244 138bc75d-0d04-0410-961f-82ee72b054a4
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