aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aggr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-07 15:06:22 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-07 15:06:22 +0200
commit8da337c5025772d12fd6e6c9bfcc8fbd1307461a (patch)
tree4f4a5f0b697a0462eb05ecd4890bfa273f445573 /gcc/ada/sem_aggr.adb
parentdcffd51576e6d3c1f8059656b5853608534fa63d (diff)
downloadgcc-8da337c5025772d12fd6e6c9bfcc8fbd1307461a.zip
gcc-8da337c5025772d12fd6e6c9bfcc8fbd1307461a.tar.gz
gcc-8da337c5025772d12fd6e6c9bfcc8fbd1307461a.tar.bz2
[multiple changes]
2010-10-07 Robert Dewar <dewar@adacore.com> * einfo.ads (No_Pool_Assigned): Update documentation. * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Storage_Size): We only set No_Pool_Assigned if the expression is a static constant and zero. * sem_res.adb (Resolve_Allocator): Allocation from empty storage pool should be an error not a warning. 2010-10-07 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Expand_Array_Aggregate): Recognize additional cases where an aggregate in an assignment can be built directly into the target, and does not require the creation of a temporary that may overflow the stack. 2010-10-07 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Analyze_Record_Aggregate): In Ada2012, a choice list in a record aggregate can correspond to several components of anonymous access types, as long as the designated subtypes match. From-SVN: r165104
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r--gcc/ada/sem_aggr.adb17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 50af15c..6ef11bb 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3890,8 +3890,23 @@ package body Sem_Aggr is
elsif No (Typech) then
Typech := Base_Type (Etype (Component));
+ -- AI05-0199: In Ada2012, several components of anonymous
+ -- access types can appear in a choice list, as long as the
+ -- designated types match.
+
elsif Typech /= Base_Type (Etype (Component)) then
- if not Box_Present (Parent (Selectr)) then
+ if Ada_Version >= Ada_12
+ and then Ekind (Typech) = E_Anonymous_Access_Type
+ and then
+ Ekind (Etype (Component)) = E_Anonymous_Access_Type
+ and then Base_Type (Designated_Type (Typech)) =
+ Base_Type (Designated_Type (Etype (Component)))
+ and then
+ Subtypes_Statically_Match (Typech, (Etype (Component)))
+ then
+ null;
+
+ elsif not Box_Present (Parent (Selectr)) then
Error_Msg_N
("components in choice list must have same type",
Selectr);