Message ID | 20231107091958.3906017-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:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp111629vqo; Tue, 7 Nov 2023 01:21:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbrL1W7BdtzicnlHSp+3jW7T8B1wS/g+sNFdSqiHliODlUIwwEfgmD/lLTqerDXjGNLXA5 X-Received: by 2002:a05:620a:2412:b0:779:cf30:600b with SMTP id d18-20020a05620a241200b00779cf30600bmr34329023qkn.4.1699348862511; Tue, 07 Nov 2023 01:21:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699348862; cv=pass; d=google.com; s=arc-20160816; b=E5q98FVjWqR7oXuTiBJw4GiR2TR7l/TCDbiwxq1kOYHj4UbR2h9ljCZgNwVJ3jmqLu 57lYjQ/wKb8m7EcVUGHHbJ7NtBwXGi4dyTsGZDi4BawJIuV+m964vdbCP0SE8ptqLemW BbgR86RkGLN2E5GMA9hMPPMAwx5YKI+TccMmvAHFLu98oCe5njwkxkiLtLsmGj00GzHT lltvdp8jmHW32nLTB4ZqCHoOAlrLmiD2G+UrenOw3QTdvD60LYsKh6mdydSRXw2LDo3Y /SXMB36eHfke/l70m+3KxngpREhld+36ypMyKTuroBWdoZl9IVL7sY9qBwkqMil+XNNv 7D8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Ak1xGKGm6J6xUUoKphqGKJpXEizyjSox5tn/onKo7tA=; fh=SwZJ83OSkcrddnVqQxMJIeT7CBiRDh1+Xn8c83Fto+4=; b=c/9pYWd06PyWJKNpx3OXjBgLHnlta4UPwyxTmodb/xOa6pWW/xvM/K9cD6tGR+tFfW 5UyfZdEV2Z8ZxGYRm7Q1U13hyBA0yKITzAa/Dr6exSng2G9kiFsEzkLKMxN2vPNm3UUG na1bQKrr9vnmCawPeV76xPdJ/yem7Bvis5tXPErrvwGUExYJER/OAr9sTr79sy42Dxcg jBqMUCAwMcudIfNR3x6XIAGzx8zRL52Wh6l/kLfQtlzJCmDZZ6BcE/l+QkVS/5Wiic5+ xZYLKmMsKj62Yh1IWVAjlZmcMVbUkC7Jkkv4zWPsJ1uQ6lMlyICt38KVyQmr+wrZERLj VNzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=jBM9JjnF; arc=pass (i=1); 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=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j22-20020a05620a411600b00773c2e5bbfbsi7222641qko.530.2023.11.07.01.21.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:21:02 -0800 (PST) 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=@adacore.com header.s=google header.b=jBM9JjnF; arc=pass (i=1); 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=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F3D23861820 for <ouuuleilei@gmail.com>; Tue, 7 Nov 2023 09:20:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id C86BD385C6F5 for <gcc-patches@gcc.gnu.org>; Tue, 7 Nov 2023 09:20:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C86BD385C6F5 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 C86BD385C6F5 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348803; cv=none; b=tAq20EE7dxGy75hEq8XT3BKI+Tp1VvXjw3Wax5Y+DxAcV3fyz4HfpeDgTVyQM3BV9Cvag2NuowdbYtNKnHeT67uvroGCCnhCUz9Zonv/ZQKxbS0VDvjPzLoL0mF125+sGjguHWZMpVwaqlZPHzxrZv7q5XPETRkX5KeIdvoXMK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348803; c=relaxed/simple; bh=hh9tjJvAZJt/ehl6lEX/iyh7XGKb3ySCN/1ltJN20K0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VczoQr15i0lKHqDFLxhJLUDVMGLouq/SZuq/7Aq77wto0rGSUKP2N+MTcuMRPMAuLy5WuOOAb9zXyqTuynTqmFXtVb5bY7B4GPDUNgxM6DzjPgLHLeEM7RqcwPGhRMNjmXX9IJMPj7lDzAQk2YMUsei4mEWREBibyTG5BcxlNcM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4083f61312eso41163855e9.3 for <gcc-patches@gcc.gnu.org>; Tue, 07 Nov 2023 01:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699348800; x=1699953600; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ak1xGKGm6J6xUUoKphqGKJpXEizyjSox5tn/onKo7tA=; b=jBM9JjnFbSSdTkcRuPK9SgYxq692YUPtAGG2N7E47uD8Ix9wB9lkIQcd9+S+Ir6FJ5 5bQqpTsagMB8OqojpKWX0v3NaaB8K3ATwdjDB+tbN0OsyfguAZuusjenb2Hun+qjiaO9 iVRXTo8illd39DoTSna2FOmP4oTh1IEbbwcWLZ06ggO25t4nE4TVIdFMl+nsQ5jThh9w m5aMGJnYOfTn3ZxrLz7qQiiHAhdy81Co3lH/m0GHVu7K9jlcsH/RwwPPmKdmu9rIOMHi bQHl/ASV4wSKGy1R8dV33BLMC+U2O2AYs3kOBRtSJ3uLVVauSRHhR04hMZqWB3kKE9N6 Qd5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699348800; x=1699953600; 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=Ak1xGKGm6J6xUUoKphqGKJpXEizyjSox5tn/onKo7tA=; b=kIQWhEUodOE/ok1EIVt4yM1urERuDUU9uB3RBzB3eaY46njtW2PdOT4UsrCzh4+d+1 xcacp2fJe+bjxSauFcyNQtzRUYwiiki9hsJGt7abErS1LCtTTAzxEcQpQyzy+7Yo0FLX bIx2RZ8GdzFDKidqJgpMGN+pPdBKCL5W6sbYneLC9gLklkWKqilS4enyYdjd916tuL5X bPjOCALityTyjBvq0yUIoPG0hYHi0MlGchAt7brOU/yUaJZviY5mmcY4NIBf5whMWADX 7x9CduxCaNz4SZqtPstVjIDwO8mbzlwtYubszpeySOG82EA+Zn8RFPD2e6UZ8qZQA8yv H2cQ== X-Gm-Message-State: AOJu0YxnwQf76PBTKYjHVF/ivbDi8FPQIMxgVKr7X0ZMVODhoG5+giUy Iy3lplXFJpGnZWPqN1SjcLhQA6tHEKFeX/3d+8Tkiw== X-Received: by 2002:a05:600c:4f41:b0:406:599f:f934 with SMTP id m1-20020a05600c4f4100b00406599ff934mr1923333wmq.12.1699348800612; Tue, 07 Nov 2023 01:20:00 -0800 (PST) Received: from localhost.localdomain ([2001:861:3382:1a90:dbc1:a1d1:2e58:4040]) by smtp.gmail.com with ESMTPSA id ew3-20020a05600c808300b004054dcbf92asm14509098wmb.20.2023.11.07.01.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:20:00 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Bob Duff <duff@adacore.com> Subject: [COMMITTED] ada: Error in prefix-notation call Date: Tue, 7 Nov 2023 10:19:58 +0100 Message-ID: <20231107091958.3906017-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781896433044797627 X-GMAIL-MSGID: 1781896433044797627 |
Series |
[COMMITTED] ada: Error in prefix-notation call
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
Nov. 7, 2023, 9:19 a.m. UTC
From: Bob Duff <duff@adacore.com>
The compiler gives a wrong error for a call of the form X.Y(...)
when Y is inherited indirectly via an interface.
gcc/ada/
* sem_ch4.adb (Is_Private_Overriding): Return True in the case
where a primitive operation is publicly inherited but privately
overridden.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch4.adb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 50ba6c9c847..2f3dfe71590 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -10223,9 +10223,15 @@ package body Sem_Ch4 is elsif not Comes_From_Source (Visible_Op) and then Alias (Visible_Op) = Op - and then not Is_Hidden (Visible_Op) then - return True; + -- If Visible_Op or what it overrides is not hidden, then we + -- have found what we're looking for. + + if not Is_Hidden (Visible_Op) + or else not Is_Hidden (Overridden_Operation (Op)) + then + return True; + end if; end if; Visible_Op := Homonym (Visible_Op);