]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Improved legality checking for deep delta aggregates.
authorSteve Baird <baird@adacore.com>
Wed, 30 Oct 2024 23:20:51 +0000 (16:20 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 14 Nov 2024 13:54:31 +0000 (14:54 +0100)
commit29112f5e1b2a8751349943f72c046e7ad3c8de8e
treef5e80e0914c7c1c410d3bdba56d768834fe3eabe
parent35d36903dc616059ad0b34b1057a3037ab758597
ada: Improved legality checking for deep delta aggregates.

Enforce deep delta legality rules about nonoverlapping choices. For example,
do not allow both Aaa.Bbb and Aaa.Bbb.Ccc as choices in one delta aggregate.
One special case impacts "regular" Ada2022 delta aggregates - the rule
preventing a record component from occurring twice as a choice in a delta
aggregate was previously not being enforced.

gcc/ada/ChangeLog:

* sem_aggr.adb (Resolve_Delta_Aggregate): The rule about
discriminant dependent component references in choices applies to
both array and record delta aggregates, so check for violations in
Resolve_Delta_Aggregate. Call a new procedure,
Check_For_Bad_Dd_Component_Choice, for each choice.
(Resolve_Delta_Record_Aggregate): Call a new procedure,
Check_For_Bad_Overlap, for each pair of choices.
gcc/ada/sem_aggr.adb