Message ID | 20230515094316.1408094-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 b10csp6793828vqo; Mon, 15 May 2023 02:52:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pJz/iUreZ1DRx0Fz9XzVcrsbTuUv/dGUgybzbqdzRno8CJeKY6Xtc6F/raYsgy6b0J6le X-Received: by 2002:a05:6402:1b1a:b0:504:e9cc:de35 with SMTP id by26-20020a0564021b1a00b00504e9ccde35mr25608866edb.0.1684144360152; Mon, 15 May 2023 02:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144360; cv=none; d=google.com; s=arc-20160816; b=oO5K0R+rMPWUrAB3aF6ilKbX/f3gSV0QVQDFgcBMTtXyNVzQk9Z3E2VIJ8LKHfYDIl qcIC3i6P07sh55mbdXHoSWKInirXfx3cpGQ/8q7NvCOo/WvKJr1qTXdQn3smYxPeuk9j vHkj4nw5N6PtkdnCroeRQypeWi69nlFpQC6e0UYI4vzZCVjF4NYZ+6+6QdNqORHUmme3 cRl9siZjFLXzAOrEFCowgdWcPP9Dv2WN4BkEArkSiAucT+s43HF9rMzdOkIN9QZQUz2s X1kujQaq3eO1HFJgoTgxkwHk55TNAzzxqTWrdMEHuu2zq6LnZFpSok6VwtUxaPtOeO4c ITBg== 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=fGnOgbOQOAIErwf2V3jA1HNrv+/Yn3kfY/G0HYkQ1s0=; b=w82AzYUJvO2Q5f7YEXsW7M3IrS1dCxvZYV/xMstDglTjByr4G7rWntwo20DMRl5l8L YKkBLNH31aNIF1ziSkQet1eJ5x9spJL14GrGdIial+aNOvJPlW+5f7CkHZjtnPwP37ZV iaJq87pi/lSLogPSVhis84eBRLIKwBd9KKdmvcXQTmcNXCfe9d/gFW9BUMr+YAFKm06t i9y7P753FDumQ0P1zoy+xr67caHLZ56HT6NhDwy0fXHkxBWLTzykYrMMz2d6eOXwhG0u uz96jh2cAy8lmsXkCPeoeZ1r9xwi/W4Anw0bcdzNJnG9lrA3djg6tyYM2dnVgTy54kum oSdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jB5vOrue; 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 g15-20020a056402114f00b0050a021d39besi11369142edw.454.2023.05.15.02.52.39 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:52:40 -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=jB5vOrue; 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 9E2473898385 for <ouuuleilei@gmail.com>; Mon, 15 May 2023 09:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E2473898385 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684144049; bh=fGnOgbOQOAIErwf2V3jA1HNrv+/Yn3kfY/G0HYkQ1s0=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=jB5vOrueq6Kui4AB9cuyfxgHrFLRROmR/gcV814z2+sGzejD1+LSV6XPzrBLqHB/u jyfBruUFlNiViBwhZC4NkLTuc4gKHtc+2KaP8TjIwOiIPuhoEXhWNqwAPCI3jeXJFo A6Sjv9yDzHP/45SyRQBEH5kGz79fzZUACAWJdG18= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id A206A385415A for <gcc-patches@gcc.gnu.org>; Mon, 15 May 2023 09:43:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A206A385415A Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-306f2b42a86so8167095f8f.3 for <gcc-patches@gcc.gnu.org>; Mon, 15 May 2023 02:43:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143799; x=1686735799; 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=fGnOgbOQOAIErwf2V3jA1HNrv+/Yn3kfY/G0HYkQ1s0=; b=dkZY6makoxLC5ljdITLU6rB6pUBUA4liGDCbHdKUSGDq1HFSALjS6ziY7uxAcFbqJM acI0T0r25q13RHcKWxH/K+lQhVKgfiwuxvBGKb84fia5NrRugia4bd/NU8rcZ4rvDCRD xGyMenQ+HJdCN56VrM2p2TY653Piw+0GqSeiIRVDAEV8WNUAcCFx4bTWy+l/pwf7ojSd sXUsBTzfvBasRqNXM6VQw4LYeSO+HoJgRuVwEBZU41B8oZfaru9w9qk/8Hxb5G1CxGHG ZzQOXiCnVXhALppVVtxVd/gSrOERH53Q5P45wBiL6utjaUJNXrl69s5jReXWrqG7odWv 9rRQ== X-Gm-Message-State: AC+VfDxUkGkbzDYqCMuzUyml9UYntYGOCC3/APMPVXRFeW3mqNy02HVq AY/KgMxuH8eEp6b4X+231ABT0en+QH499IFBGIF4rg== X-Received: by 2002:adf:d092:0:b0:306:31fb:1c3d with SMTP id y18-20020adfd092000000b0030631fb1c3dmr21864182wrh.32.1684143799194; Mon, 15 May 2023 02:43:19 -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 q9-20020adff789000000b002c71b4d476asm32104876wrp.106.2023.05.15.02.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:43:18 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques <desplanques@adacore.com> Subject: [COMMITTED] ada: Improve check of attribute reference Date: Mon, 15 May 2023 11:43:16 +0200 Message-Id: <20230515094316.1408094-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?1765953356533536404?= X-GMAIL-MSGID: =?utf-8?q?1765953356533536404?= |
Series |
[COMMITTED] ada: Improve check of attribute reference
|
|
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: Ronan Desplanques <desplanques@adacore.com>
Before this patch, the front end failed to catch many illegal uses
of access attributes of task types.
This patch makes referring to the access attributes of a task type
raise an error, except in the current instance case defined in
clause 8.6 of the reference manual.
gcc/ada/
* sem_attr.adb: sem_attr.adb (Analyze_Access_Attribute): Tighten
validity check for task types.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_attr.adb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 9de9884069e..ac0c4004930 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1068,9 +1068,11 @@ package body Sem_Attr is Analyze (N); return; - -- OK if a task type, this test needs sharpening up ??? + -- OK if current task. - elsif Is_Task_Type (Typ) then + elsif Is_Task_Type (Typ) + and then In_Open_Scopes (Typ) + then null; -- OK if self-reference in an aggregate in Ada 2005, and