From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id CE731385E020 for ; Mon, 5 Sep 2022 07:26:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE731385E020 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32d.google.com with SMTP id h1so4765609wmd.3 for ; Mon, 05 Sep 2022 00:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=JLStNuhejoOv2Sa3N2768LLXuDQGiCIyYANdO05UZIM=; b=fjHzE7i3/8H1SYLHHLO7aUCVkqUUTTxoJRzco+MPFw7RF7JjR4EUUi/M/v1loJchhm vvK/+DpSPIvviMRRgjjiHIB8Qi3cWnHPWunb+kJHhyu6OCThYZ/gpB29EUCgNN16EfpB 2dikmyF/aNrv5motY2482H7HXTb369g/MzZcr+NXKgbaZ/X2z1nY1+0ePoNVii5k0942 nBYJdf7mT511xspN1MLCiMM1Y78wTvoAP07OQG2Ar+Bacp/KFl+jStIOZc8AqoIA96G4 WWKxMbnBhYASW5NCIOB6kt3seWUn9pRRWPYrFatFz0ql2GLn7/WTcNYqmN9o+1jPYHBe sa3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=JLStNuhejoOv2Sa3N2768LLXuDQGiCIyYANdO05UZIM=; b=dcpDE4fzngeDZrpkFwJOKyAtbsuLADOm2/kANKsvPQXga556T95kA5yLcL3dZ5fROq deIC/cKlFNk7MUGGQp8vvjhkmfEoWzKN05WplJeQF/5QrSV4kSEAtTUWgzCh3aOkBxZ9 gpxXLZNmPSpSKvDRIcTu3hQi2S6TjsOAGeWOSANIreHQufJDEU+HrP4PK1pzU291+Agt PRUwKfnQY+esAO0T+aoZ6cUX2B5F7GZISo6UIRTP0gwSu3SX5c3DQCN+KT82fA0zEMdk JiChAx3fmaw3nxaEeM73QcdDUrsIN8eff+qjgKswQvlm4i6fh8f0IYSi3FimU+JSGVx7 NlYw== X-Gm-Message-State: ACgBeo31PXwKFA3bGjLxzn55lTZkT7vEreCqEZyuikYwgrubMocMPvyf F+Aq4HfGvci8CBX8bfly9kjHh7JzPl6Vrw== X-Google-Smtp-Source: AA6agR63FYwtg9kPzK/Scb9cSEFVKRC1CmldsuGxxUSUze2AgVwaNMh8kRgAjlo5ob1cuiI7Xx82Ww== X-Received: by 2002:a05:600c:4e8a:b0:3a6:d89:aa24 with SMTP id f10-20020a05600c4e8a00b003a60d89aa24mr10161706wmq.149.1662362776520; Mon, 05 Sep 2022 00:26:16 -0700 (PDT) Received: from poulhies-Precision-5550 (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id f3-20020a1cc903000000b003a604a29a34sm9871055wmb.35.2022.09.05.00.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:26:16 -0700 (PDT) Date: Mon, 5 Sep 2022 09:26:15 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Cleanup iteration over aggregate component associations Message-ID: <20220905072615.GA1174852@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline X-Spam-Status: No, score=-12.8 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 List-Id: --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Code cleanup related to fixes for iterated component associations in GNATprove ; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Container_Aggregate): Style cleanup. (Resolve_Record_Aggregate): Remove redundant guard. --T4sUOijqQbZv57TR 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 @@ -3182,7 +3182,7 @@ package body Sem_Aggr is end if; end; - elsif Present (Add_Named_Subp) then + elsif Present (Add_Named_Subp) then declare -- Retrieves types of container, key, and element from the -- specified insertion procedure. @@ -5048,9 +5048,7 @@ package body Sem_Aggr is -- OTHERS cannot be used. -- Positional and named associations cannot be mixed. - if Present (Component_Associations (N)) - and then Present (First (Component_Associations (N))) - then + if Present (Component_Associations (N)) then declare Assoc : Node_Id; --T4sUOijqQbZv57TR--