diff options
author | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2017-09-29 13:22:45 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2017-09-29 13:22:45 +0000 |
commit | ccd0ed95a86f0034daa452b0bb82b15ab47b284a (patch) | |
tree | 0f01c43173a6cfa0996666eeddc9f0b3163f4a3f /gcc/ada/sem_aggr.adb | |
parent | 1dce26a11dca29ffe5c3f2e5fb97fcb5830543e8 (diff) | |
download | gcc-ccd0ed95a86f0034daa452b0bb82b15ab47b284a.zip gcc-ccd0ed95a86f0034daa452b0bb82b15ab47b284a.tar.gz gcc-ccd0ed95a86f0034daa452b0bb82b15ab47b284a.tar.bz2 |
[multiple changes]
2017-09-29 Justin Squirek <squirek@adacore.com>
* sem_ch8.adb (Analyze_Use_Package): Add sanity check to avoid
circularities in the use-clause chain.
2017-09-29 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Replace_Components): Update references to discriminants
located in variant parts inherited from the parent type.
2017-09-29 Javier Miranda <miranda@adacore.com>
* exp_ch5.adb (Expand_Assign_Record): Do not generate code to copy
discriminants if the target is an Unchecked_Union record type.
2017-09-29 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Record_Aggregate): Reject the use of an
iterated component association in an aggregate for a record type.
2017-09-29 Piotr Trojanek <trojanek@adacore.com>
* make.adb: Minor whitespace fixes.
* libgnat/s-resfil.ads: Minor reformatting.
From-SVN: r253288
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r-- | gcc/ada/sem_aggr.adb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index c885ce9..ad6e1ea 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -4108,15 +4108,22 @@ package body Sem_Aggr is begin Assoc := First (Component_Associations (N)); while Present (Assoc) loop - if List_Length (Choices (Assoc)) > 1 then - Check_SPARK_05_Restriction - ("component association in record aggregate must " - & "contain a single choice", Assoc); - end if; + if Nkind (Assoc) = N_Iterated_Component_Association then + Error_Msg_N ("iterated component association can only " + & "appear in an array aggregate", N); + raise Unrecoverable_Error; - if Nkind (First (Choices (Assoc))) = N_Others_Choice then - Check_SPARK_05_Restriction - ("record aggregate cannot contain OTHERS", Assoc); + else + if List_Length (Choices (Assoc)) > 1 then + Check_SPARK_05_Restriction + ("component association in record aggregate must " + & "contain a single choice", Assoc); + end if; + + if Nkind (First (Choices (Assoc))) = N_Others_Choice then + Check_SPARK_05_Restriction + ("record aggregate cannot contain OTHERS", Assoc); + end if; end if; Assoc := Next (Assoc); |