From patchwork Mon Nov 21 10:13:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1707095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=NyOGMtmN; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NG3Bw3nrQz23nD for ; Mon, 21 Nov 2022 21:13:59 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BD433852C4C for ; Mon, 21 Nov 2022 10:13:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BD433852C4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669025635; bh=+feOfgt2/0Fc9aF1lIGMfIbfGekDrdHCCOlmcEfv3ng=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=NyOGMtmN+eVdX3Om+1xPhNFiwoSBoEGrmdHIFIFzBGPWuGuGgLW0m6yLltEddGklW Cw8EdVZVXzDMCtg2jURaPh/COkRWOZ3IFTer2466jLE06F4AWyDfGcQHdXPlXAtMeL gCktuEv7ZmuImeSeicCmsE7aBx6Jfce6S06yCM90= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 2F496384F496 for ; Mon, 21 Nov 2022 10:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F496384F496 Received: by mail-wr1-x42d.google.com with SMTP id e11so6161990wru.8 for ; Mon, 21 Nov 2022 02:13:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=+feOfgt2/0Fc9aF1lIGMfIbfGekDrdHCCOlmcEfv3ng=; b=5X9c0XKmCjO7KasuVDiSiDD54OOPQ99ZUyan/g8yiTUxzLIuja99AMyGrEbpSsU+zR /Sa5iRDbLs5u/dI7+XVc6ALk1RVN9hwFuJIa6hJ4olQYa8f2FCxMQjARkJkJjT8PPT/g MQxf881fvBoUh/Pckv4EKXgrbiHeLdr3OZQBv1vnzVkFcQGj+NgJAiX/pRifNQdFzDYW 05YPCSjIXVQpJDBhX8Telrh+6OYaHvLXYgPSRKForrf2cihhV8tMMhDuAbjrrQfihWUo Ps0OgN2P5fYuQQWC85oFlsjr6hLBAmIVfkAjIARtW3ImSFvxPXfubePFj3Jmi0MPNwwl 5o5g== X-Gm-Message-State: ANoB5pmFZoUEHqYskmmlV+8dVg04TRIpZOLbMTGTIHljW6bwJDHvmt86 WXQbB+JG86M0n5jGaT57v7fEhUq8LAW+xg== X-Google-Smtp-Source: AA0mqf4FTA6CkOAE7p8bN/zYxxpZw2xggdT7YOD+RoTVziycXMNKqs8NqOr/JWYOUV0+vf4H5/aPpA== X-Received: by 2002:a5d:4c48:0:b0:241:bd2c:bef with SMTP id n8-20020a5d4c48000000b00241bd2c0befmr4674643wrt.304.1669025612989; Mon, 21 Nov 2022 02:13:32 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id v11-20020a05600c444b00b003b95ed78275sm14158186wmn.20.2022.11.21.02.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 02:13:32 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED] ada: Tweak error messages on misplaced with keywords Date: Mon, 21 Nov 2022 11:13:29 +0100 Message-Id: <20221121101329.258908-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Ronan Desplanques Before this patch, with clauses placed in declarative sections were interpreted by the compiler as incorrect aspect specifications, which led to confusing error messages. This patch makes it so more syntax errors involving the with keyword are diagnosed as intended with clauses instead of aspect specifications. gcc/ada/ * par-ch3.adb (P_Declarative_Item): Tweak handling of with keyword. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index aac45890c97..483f96d041f 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -4682,7 +4682,7 @@ package body Ch3 is when Tok_With => Check_Bad_Layout; - if Aspect_Specifications_Present then + if Aspect_Specifications_Present (Strict => True) then -- If we are after a semicolon, complain that it was ignored. -- But we don't really ignore it, since we dump the aspects,