aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2008-04-13 18:15:20 +0000
committerSamuel Tardieu <sam@gcc.gnu.org>2008-04-13 18:15:20 +0000
commit92d4508a7db153423b0572047fa6947af569d4b6 (patch)
treec4b975b66545fd016e2b72fc1d429e06e87136df /gcc/ada
parent3354f96dac09a7c57641fd19083f3aefe0790a35 (diff)
downloadgcc-92d4508a7db153423b0572047fa6947af569d4b6.zip
gcc-92d4508a7db153423b0572047fa6947af569d4b6.tar.gz
gcc-92d4508a7db153423b0572047fa6947af569d4b6.tar.bz2
re PR ada/17985 (GNAT accepts extension aggregate where expexted type is not extension)
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. From-SVN: r134244
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_aggr.adb4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b6f6139..7531411 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-13 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/17985
+ * sem_aggr.adb (Valid_Ancestor_Type): A type is not an ancestor of
+ itself.
+
2008-04-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* sfn_scan.adb, sfn_scan.ads, sinfo.ads,
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index f930ecb..5c7d9bd 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