Message ID | 20240823085359.1399344-12-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=MwLFasBu; 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 4Wqv964K9Mz1yNr for <incoming@patchwork.ozlabs.org>; Fri, 23 Aug 2024 18:57:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72231388204A for <incoming@patchwork.ozlabs.org>; Fri, 23 Aug 2024 08:57:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id C54693875DE7 for <gcc-patches@gcc.gnu.org>; Fri, 23 Aug 2024 08:54:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C54693875DE7 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 C54693875DE7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724403275; cv=none; b=GefYhKH6wnxFP9FjCfBM+5c7xKmj/WBFh53Zf3KGrwGxCpyiTABVQRNciOt4rbR51YgjWkht1X4csbp/rH5Qbv0ozBcZ4VNV0/s5KgqacRPU4sPXf4yzDSR/AN00s2gsAqcEbkk32lvUZI3EIqXrE+okBaBk1Z4LASiKwOY9rf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724403275; c=relaxed/simple; bh=fP2HNO6ILBwJ/dK5twTMkJwmwXNgfs3zjVP76yF/CT8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Uu/CetgzqhupvwtS46sOJboYJnB6VX7yHCPXkgwnRCnLsNhI+lD8AsZjVBlHowZMYWPlFYnrJ9YupZ79c1K8e9VbtBP806IuCf1EPfNl66mEZjX8ZO+lBYWQXkfNFKjvqXEb/zmPeb+1at8frrxReYX4L7LuwsqXGdJ0Z6HEcYE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-428243f928fso17278945e9.0 for <gcc-patches@gcc.gnu.org>; Fri, 23 Aug 2024 01:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1724403270; x=1725008070; 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=4F6hJT0vj8D0HiAhi8qD76Q0qkoC9cS/CpiTdKEKq5c=; b=MwLFasBulIPFS8M3QszqGlwNF2rVndKZ0PkQtFPiN145gDqbImXNxj55XFc13QuojX Gr3Whf9al6NNMrbeJ4WeQ0YVbh7rNbCEkQCdp47P+W7Swl8V/+Cgb2H6SWlq+mdNhagL osU+kfu+//ZGz30nFuhtJy4515QrZkPsg0Xrqf3knTvJicb+JOeuFcAAg3wYYGwVu5Gn TqxHlMYfGRdQLcdiUb14kxEkie5UDkpiqTtiXGtpsqqWRSha4g9b1pI0V43qlsJSYzKx Ci/cG3y8giRqKRVSuqPK/L0sscRmOY6KSo0e31diLSTicwsSI9PLuNrFIerpeaG3Dcon CKYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724403270; x=1725008070; 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=4F6hJT0vj8D0HiAhi8qD76Q0qkoC9cS/CpiTdKEKq5c=; b=PACpo7RMkpZsVZcKZst03XV7FfDjIxYDVlX5ZHk/V/sbKKuQxOMU+Z1zCon4gESbLA y8eM5dO7SO94c5kG88HrfTSNIbjqd3QUmN/BiVrWDu1o8u6nQk3yjSKAF8EOAcVBTcpB M8MB8KbxlUy490gBVf2LxyuRsenvIPC0SpeVI2QpgNUjw4vzM2mk+s15x2s/oxzF/HbK H6aD7TBx9sCPPCT2c92ai8DrQ9LCnBpXQJz9NyDJgyq2JYbcIXDDUP3AZevgGxTQ9jvP S7PE96o3Y1WkUtTMs8QOmC7TSbH4HR0n9ows0K6T1dpaJXm1JZChJiDZTDr+W/XeCxQM Ut8w== X-Gm-Message-State: AOJu0YyKtVFnf2FMIy9k/bbwQeenJt9nUwOSxu7fSfbAYCuD0Y4sT+Sh Y9mAo2yRCGKvGnZMXG6O8bur6NzFKjmHubqC4gWRkeETimpamK5uYaX7Udj+g0QrrUowDwgF0Rc jhA== X-Google-Smtp-Source: AGHT+IGnqHKqQhjVArTOePNExmfgIAUpbm6q0756w18wQfAkAxrfTzNIJ/aVqkUxgxRV/+PzLzFLDw== X-Received: by 2002:adf:b317:0:b0:368:4489:8efb with SMTP id ffacd0b85a97d-373118c84eemr1220253f8f.40.1724403270158; Fri, 23 Aug 2024 01:54:30 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:a526:e9dd:5148:f199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730821a902sm3598887f8f.97.2024.08.23.01.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 01:54:29 -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 12/16] ada: Implicit_Dereference aspect specification for subtype incorrectly accepted Date: Fri, 23 Aug 2024 10:53:53 +0200 Message-ID: <20240823085359.1399344-12-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240823085359.1399344-1-poulhies@adacore.com> References: <20240823085359.1399344-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.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 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/16] ada: First controlling parameter aspect
|
expand
|
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 0546aa37de7..a55ba3c7bd9 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1982,6 +1982,11 @@ package body Sem_Ch13 is Error_Msg_N ("aspect must apply to a type with discriminants", Expr); + elsif not Is_First_Subtype (E) then + Error_Msg_N + ("aspect not specifiable in a subtype declaration", + Aspect); + elsif not Is_Entity_Name (Expr) then Error_Msg_N ("aspect must name a discriminant of current type", Expr);
From: Steve Baird <baird@adacore.com> Implicit_Dereference is a type-specific aspect and therefore cannot be legally specified as part of a subtype declaration. gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Generate error if an aspect specification specifies the Implicit_Dereference aspect of a non-first subtype. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 5 +++++ 1 file changed, 5 insertions(+)