From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 71FBA3858C36; Mon, 7 Nov 2022 08:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71FBA3858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667810342; bh=7CtppxrUeTWUB+A7Sjp8kYzNE8sivFw5kzh/WjA56nE=; h=From:To:Subject:Date:From; b=eLoT6Spu7uc4nDtHISB+Jtj5vrxQhCwssSA6/xwzbfsnbo0LuKNxzo3utwI93G7w2 LnLzg9KELk7dtPkiwRdjZrLC+USES0KvWNJh2uJ5FbF90plkqdkphDsxIK+ALCzf2O sBhwToK1MFFqrne8OH+z7GvzACrMgeQJVJden8NY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3730] ada: Reject boxes in delta array aggregates X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 8f077c4d05876bf952c86131e477d21dc5d4492b X-Git-Newrev: 2caaa4bf336bce2a7d649aa05f2851d576a26e5e Message-Id: <20221107083902.71FBA3858C36@sourceware.org> Date: Mon, 7 Nov 2022 08:39:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2caaa4bf336bce2a7d649aa05f2851d576a26e5e commit r13-3730-g2caaa4bf336bce2a7d649aa05f2851d576a26e5e Author: Piotr Trojanek Date: Thu Oct 14 17:50:43 2021 +0200 ada: Reject boxes in delta array aggregates Implement Ada 2022 4.3.4(11/5), which rejects box compound delimiter <> in delta record aggregates, just like another rule rejects it in delta array aggregates. gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): Reject boxes in delta array aggregates. Diff: --- gcc/ada/sem_aggr.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 87a8c1a3c40..31ce9cadd94 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3531,7 +3531,18 @@ package body Sem_Aggr is Next (Choice); end loop; - Analyze_And_Resolve (Expression (Assoc), Component_Type (Typ)); + -- For an array_delta_aggregate, the array_component_association + -- shall not use the box symbol <>; RM 4.3.4(11/5). + + pragma Assert + (Box_Present (Assoc) xor Present (Expression (Assoc))); + + if Box_Present (Assoc) then + Error_Msg_N + ("'<'> in array delta aggregate is not allowed", Assoc); + else + Analyze_And_Resolve (Expression (Assoc), Component_Type (Typ)); + end if; end if; Next (Assoc);