[COMMITTED] ada: Accept aggregates with OTHERS clause in unchecked type conversions
Message ID | 20230515094335.1408296-1-poulhies@adacore.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6794404vqo; Mon, 15 May 2023 02:54:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xL47H5wsvJ+ftmQYAVvz+9JJeCVUrsonG1yCZZo2hKEidEHB0hLrm6EMG3PAs8lfb62tN X-Received: by 2002:a17:907:1607:b0:94f:1c90:cb71 with SMTP id hb7-20020a170907160700b0094f1c90cb71mr34207437ejc.65.1684144453815; Mon, 15 May 2023 02:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144453; cv=none; d=google.com; s=arc-20160816; b=Id3x5GnaxEnsG6EvCRgGxHS7gM3H64r9VsaTbV7rqt/yrUz/cbAul6rv0Bn865qbg3 4xHWLxwuIDpF2rJ2cO1NcZmnvLdIOPEHJHcdMsxOz6oOHxGDYvVrHxNA7kSp86FmqZge qkhXPLNgc6OMX+/QOMhqrYZ+pXCUNZOZoZJSOnwKeITpnuqyEK71mTajADnMZ/v3KpNl C7geUvEsCUy2Ny1of4OXmSVDjd0ZmmKeSE/15P8X+jPVJQ2109WHAbI8OPH99R8ct0cU LWeLEybPzcBGCKXfJCZ+9TEzg8IBjEfYLDVhaKn7s0Dp/Sh6moRJ5HB/QCP9ouOUKOi1 E0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=VV8vuj/VrQIZSEJoR3z7D+e+OC7J3c5sil0lhRPcTfc=; b=VU7Qff/+idEwZz4IqR0Q0yqxpE/v/6SnLvcV3BMFNoyKbBvSsl+orE+dZb8AqMDWtN OWPSAn0FtSvj4Vh21Znk/Fipw+PMKJS2fYUSP+GpYSqB2IUMQHmyT31bUnfTMq5qGBtm CiH8PsFWWWNdsbu8xqEg23xp8vcyCgUWbrvT8CRkxRlvs37X0Fxw5YdO595usYwtYzEU 1pfMBSe1auaLxCZHN3DQ32uHitNn0a/1C+7xpf9OK1MzECZtXm7LRMefzDaf+EqoWAO6 A2rMAOHEc/HOJJJgTXCi4nTs9FBZ+8z/ug4h2TWQ5fZCjO/yDd+ys2t/SBn/gYaDzWI6 GJ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TFolkAjB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id tb16-20020a1709078b9000b0096a045e2cc1si12222698ejc.1047.2023.05.15.02.54.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TFolkAjB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A06453853558 for <ouuuleilei@gmail.com>; Mon, 15 May 2023 09:48:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A06453853558 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684144096; bh=VV8vuj/VrQIZSEJoR3z7D+e+OC7J3c5sil0lhRPcTfc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=TFolkAjBuFS7rMc2vbWbP/pFqPpPSruzdQ7oPlADVlm+UYiwy5bGOJtg2LWlwpuhq mvro+R+1KbLLWYp1fVWsK437h1umRVYorLFthF2qvSNhArm6jK5TOrrywv4pY8lwHm hbaFI857L3OrWXTGruXPKE5CacLdT31yUYLzaXkA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 9418E3854141 for <gcc-patches@gcc.gnu.org>; Mon, 15 May 2023 09:43:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9418E3854141 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f435658d23so62422865e9.3 for <gcc-patches@gcc.gnu.org>; Mon, 15 May 2023 02:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143817; x=1686735817; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VV8vuj/VrQIZSEJoR3z7D+e+OC7J3c5sil0lhRPcTfc=; b=GUKBzBQ38iGKQJ7+vkhSklg6bXzjuGg7jHgSjKamJPNFcsOtvEaS7BZbjluM/0oWxQ r8yBvW1SF4roOVxHF3RM2vuhGlz5CwKJQFkSqzjzCGqaMqOiruuH9OoBS24PYU4utn65 lMB/ZIyR64IidR00WNiIiQm5ugWpWIrWCNqo7CNjvZvBpo77loEnULedjOw6awXRAhL4 ULQBu/c754nRuoZRWf9RsLzdkYFRY2dtm9myp33BzQoa2pvH0nA1bOdqWTtlmJEEHGwB R02wlXWqfWpWKF3Lgg48ZK5oDkZsB+WJPa0nNNRvSKvIQmxphnhUK3LpiPnhhgv4NALI S2iA== X-Gm-Message-State: AC+VfDwntAOHM5tLaDk2n4ttYpDsEfUaAAqfQZ2b2RbPDbaqftgG8vNH 91LcRkezpyyTRIRCQQX078b4FXo3wChTF25mNJy0XA== X-Received: by 2002:a7b:c4c3:0:b0:3f3:1cb7:b2a6 with SMTP id g3-20020a7bc4c3000000b003f31cb7b2a6mr23395375wmk.6.1684143817401; Mon, 15 May 2023 02:43:37 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id a11-20020adfeecb000000b003048477729asm31754414wrp.81.2023.05.15.02.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:43:36 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek <trojanek@adacore.com> Subject: [COMMITTED] ada: Accept aggregates with OTHERS clause in unchecked type conversions Date: Mon, 15 May 2023 11:43:35 +0200 Message-Id: <20230515094335.1408296-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765953454933563027?= X-GMAIL-MSGID: =?utf-8?q?1765953454933563027?= |
Series |
[COMMITTED] ada: Accept aggregates with OTHERS clause in unchecked type conversions
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
May 15, 2023, 9:43 a.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>
When inlining subprogram calls in GNATprove mode, the actual parameter
is wrapped in an unchecked conversion. If this actual parameter is an
aggregate OTHERS clause, then the type of unchecked conversion allows us
to resolve this clause (just like for aggregates wrapped in a qualified
expression).
Previously such aggregates were rejected, which caused spurious and
cryptic errors; now they are accepted.
gcc/ada/
* sem_aggr.adb (Resolve_Aggregate): Accept aggregates with OTHERS
appearing inside unchecked conversions.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_aggr.adb | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 3ebb30d64ed..2ccfe6dcaef 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1180,6 +1180,7 @@ package body Sem_Aggr is | N_Component_Declaration | N_Parameter_Specification | N_Qualified_Expression + | N_Unchecked_Type_Conversion | N_Reference | N_Aggregate | N_Extension_Aggregate