Message ID | 20240702132130.523603-11-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=gEhlrPNz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WD3Zj5wKXz1xpN for <incoming@patchwork.ozlabs.org>; Tue, 2 Jul 2024 23:26:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1669F3882126 for <incoming@patchwork.ozlabs.org>; Tue, 2 Jul 2024 13:26:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id DC93F3882073 for <gcc-patches@gcc.gnu.org>; Tue, 2 Jul 2024 13:21:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC93F3882073 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC93F3882073 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719926515; cv=none; b=kppYZP0l1hdmt8y6mfpJ6JGvrxh72LFg2esxmZ8vD1e7TYSkTlBFMid2j3tCal2Xf6qhYFgYqx9IpTeDtK88hSWCj4HTR2o7RztXx5VaTRCz1LBxLu7+QwAYlcbpXYnuFON4fke1zjpvyaCDFmljsQyqAXA4FjDQP+M/iLyweH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719926515; c=relaxed/simple; bh=wUDfO6a1BzqUOq7YGWgq1msHs+lBArG11ERciAkoXDo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ChFtGdHCgxo3ijtA/2xhkNc/hgczoB6RTAaDlgzFplztBmSC/YCj46RYuAqoaeOvvmybIDoWtJ9m4iJX+1jj50VJI5jdoLqfGEI8GvGcCf6vjkSFjmhr4fmFi2ZSevV6g4musJ8befB4u89y+0aOwrpejbeq6of3xx2biAyJRw8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-52cd628f21cso4364616e87.3 for <gcc-patches@gcc.gnu.org>; Tue, 02 Jul 2024 06:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1719926511; x=1720531311; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dJ2rMI0TSHRDo+bfesaPBFAqGyrvqALIQhOnMBElujo=; b=gEhlrPNz7PXNb2DYLDWJOVgtwfuRLXSUsaFLrIAIJWMRUUCsAcMeSyJ8bhWrlJbFyA a5182GFNvjiHxR4Z1Ikxr75gchPqdnVIgPzIIXm2tApHd7ZDNeG3XXTGYiMRB7BAFs/4 NiSWfGZmDgqpoS/EcPx9NZ1OIodUSJCShx4DA6dh2aXYbeom4oLBATvH4FcTE61fUS0t e+FAmCcwOXKAD6AwCI3VmRzSjjkB9HaxVJ9yxpMp6iWthL7tonrxGR4ShORMNaXCDkem PZ5bgYeghs57EhJH42igugbB556xmuLHN52f/FbJemNrTlyeayeJtnp8WK5ToMpeRhtG pIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719926511; x=1720531311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dJ2rMI0TSHRDo+bfesaPBFAqGyrvqALIQhOnMBElujo=; b=IetFMufhAHH4mqo5twp45ffufZp+E+ILlGyg6q1NLsVzMhXN0NYnSzQsgG3LSk8Sf7 apDKyzLMsTyySr3zrGGpyDgwdUO3LiPmwE6cdvIEN4draUcTRDjojqRxgcNmHJ2cU8NU MirbakeI1QM/JkkX5bTpaFKYT+SR2hoBQPJNmh7tfeERq22h+or7zWeq8Svx9wVxs7hG zzka7LQJOZiI/TCzA3KbQe3X3wBS7/VBgCroQkVsEZTrOvws2+h3Xb5+aoUno4Xls1ov jdB9pZNGI5mKa+fg56EpeRlrvqOVqctuSxFj1DZ6UVlikJ9XKykgAuufJrptZDb/7gX2 sgUw== X-Gm-Message-State: AOJu0YxzbAZA5ejHDFTws/HA5fVyy0YFCzVIOab72y2Zi57JKsuODGa0 n64OnA7UJjK0LWsmy3YTIeaaVgRTNa3q8a8NlfQVXFTuswsbR9s01PIZ8T6nXTpqeDSmwoGvvmc = X-Google-Smtp-Source: AGHT+IH/xlljohlO21aqbpbz7LUgM15WgS0S13goV3K0tzYvuzFOObPe8WvgI6ojUBYJb41FuATG7g== X-Received: by 2002:a05:6512:1251:b0:52c:cda0:18bf with SMTP id 2adb3069b0e04-52e8264e643mr6755301e87.4.1719926511458; Tue, 02 Jul 2024 06:21:51 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:53cf:a5ff:fb60:5a70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256b09abbfsm197319895e9.35.2024.07.02.06.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 06:21:50 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Steve Baird <baird@adacore.com> Subject: [COMMITTED 11/13] ada: Compiler accepts an illegal Unchecked_Access attribute reference Date: Tue, 2 Jul 2024 15:21:27 +0200 Message-ID: <20240702132130.523603-11-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702132130.523603-1-poulhies@adacore.com> References: <20240702132130.523603-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.9 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.30 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> Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,01/13] ada: Document that -gnatdJ is unused
|
expand
|
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index d56c25a79cc..0b0adac1126 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1582,6 +1582,13 @@ package body Sem_Attr is then Error_Msg_Ada_2022_Feature ("nonscalar ''Image", Sloc (P)); Error_Attr; + + elsif Present (Image_Type) + and then Ekind (Image_Type) = E_Access_Attribute_Type + then + -- reject Some_Object'[Unchecked_]Access'[Wide_[Wide_]]Image + Error_Msg_N ("illegal Image attribute prefix", N); + Error_Attr; end if; end Check_Image_Type;
From: Steve Baird <baird@adacore.com> The compiler incorrectly accepts Some_Object'Unchecked_Access'Image. gcc/ada/ * sem_attr.adb (Analyze_Image_Attribute.Check_Image_Type): Check for E_Access_Attribute_Type prefix type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 7 +++++++ 1 file changed, 7 insertions(+)