From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 300823857C67 for ; Wed, 20 Oct 2021 19:27:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 300823857C67 Received: by mail-lj1-x234.google.com with SMTP id r6so361985ljg.6 for ; Wed, 20 Oct 2021 12:27:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=KnfS6G81i4FSBBWAGYZOLiHciIOBsKuhH725Tsu1PSI=; b=EHu6QCt9wra4zyYjSD3bJANqZ4mCFEZouPRDMi3hkd7c0+qw6tdm5zpDO4Wv8R2tDj Ud3VEKJ8AGZ/5L7iwzvVk4OOiXX3zcBP9xgORkxheZMSt3HodqegoVlI/ti4agmUa3In a6/2hqkrEZFHF8qAuBezxCwDFsmqUnp2umJlYKvJI0on5f5CNDHuQuXhr8yhsnvuEW1x e2zTRQvfEVmXtqd0ELa+f0UjDm/97/EkPiZxuJEyqV5+M8csRZnaizB3UhKIR2ypT3Y8 GCiAj3UZjFoR81f5kxXpqqPY8YoAK0AAarZtFaqhykIHZ0tHKGOfbtQ1SkLCPFg81PRD Ddiw== X-Gm-Message-State: AOAM533L0RW4EB53UE2OOd/6rLSWrgKuV33ldnMWPmERcak0lEEd01wR /qSpcG96aMQbgzNpFo/vse2ZWv3wMQT3ieh4 X-Google-Smtp-Source: ABdhPJxQ524TzkyetZDl08t2DTkn8tUvTEvl+d92FoKXtwwEmDh/FuaF9LEr1CFLru4EgNwqsbnN3Q== X-Received: by 2002:a05:651c:1546:: with SMTP id y6mr1064545ljp.394.1634758073104; Wed, 20 Oct 2021 12:27:53 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id x20sm260951lfu.196.2021.10.20.12.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 12:27:52 -0700 (PDT) Date: Wed, 20 Oct 2021 19:27:51 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Reject boxes in delta record aggregates Message-ID: <20211020192751.GA3154276@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2021 19:27:55 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Implement Ada 2022 4.3.1(17.3/5), prevents box compound delimiter <> to appear in record delta aggregates. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject boxes in record delta aggregates. --jI8keyz6grp/JLjh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3545,7 +3545,19 @@ package body Sem_Aggr is end loop; pragma Assert (Present (Comp_Type)); - Analyze_And_Resolve (Expression (Assoc), Comp_Type); + + -- A record_component_association in record_delta_aggregate shall not + -- use the box compound delimiter <> rather than an expression; see + -- RM 4.3.1(17.3/5). + + pragma Assert (Present (Expression (Assoc)) xor Box_Present (Assoc)); + + if Box_Present (Assoc) then + Error_Msg_N + ("'<'> in record delta aggregate is not allowed", Assoc); + else + Analyze_And_Resolve (Expression (Assoc), Comp_Type); + end if; Next (Assoc); end loop; end Resolve_Delta_Record_Aggregate; --jI8keyz6grp/JLjh--