Message ID | 20240801151738.400796-7-poulhies@adacore.com |
---|---|
State | Committed |
Commit | ed8612ac09baa12d025a019b43acec975978ce9e |
Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B1FE384F4BA for <patchwork@sourceware.org>; Thu, 1 Aug 2024 15:35:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 939493861029 for <gcc-patches@gcc.gnu.org>; Thu, 1 Aug 2024 15:17:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 939493861029 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 939493861029 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722525491; cv=none; b=XxYuZ1n6HO//wWaDWetHKc3cZeLpbz9urakHYzHOwr9nCRUQnbShkhL80aCBQtrPR59s0PDfIv1J/LDFHw6468AlIxQZ8j4V33z+xM89CP8AGwfZ8JUiUZrDTlKvqhpObQUwYTWmYSzvQug5rR2RGvlmzAnAkgPtvrm9HyeR4xc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722525491; c=relaxed/simple; bh=tAn5ChrVUgi73eRzNLLv8C0cfXHuKGGprngJjZRn4ro=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sgDqtylbBGKD3AE1BUDzT2ISG/GLgx/QFJp8EFP1LE+9gOpW8oonX3Mynxc3x99SrJfxO/IpHGAqf2ImugCeV7rtoeTcd9s/M7JoBuJ91NmU98rnUw3UbQ4JZxisxON9YZRvM0U8eanGtd1cANB28u1zTjVL48WiwOpoe+RbiQc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-368663d7f80so3573142f8f.3 for <gcc-patches@gcc.gnu.org>; Thu, 01 Aug 2024 08:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722525476; x=1723130276; 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=sVdTeD1mLj1O2f+ALPo2XZSwQ7e4Wi9EG3wtQEEsAEU=; b=aCvMp1TDSzB4RN7nAJeL/6Lw6SpiCVecWBMYxv6/Wh58B4zDybjdpSJoRc61n/TTbF JngMD8k46RDzRZmZumWav8vfceGU2OhDnCD0ygsT0AI8zPzz7qXf16ORBCCWSHHYW7fP 1yfgIoDcXPUA7viwMcRNE+kpC51rbT85Pb6LS2UxFpRed27Gc6O6y5WVxTJGi49LsLJr 03Lk0hsDtfEV8Y+Sp/0jnIXSo1dgAV7GHGAwunF2cAmDFHa+HPYbHEmiHdnWSfH8a5Tp 6W7Qb9WFEvu7XEeosYRusoUszdKeASsIt+mXThmNK1n6Ljj+oZXlvTVWk9hBYzEKmN7N z+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722525476; x=1723130276; 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=sVdTeD1mLj1O2f+ALPo2XZSwQ7e4Wi9EG3wtQEEsAEU=; b=vYAUP2P3eiyHKefjVK5jM67jSjeI8d9etZWETOj7lDqdIf+lShfij03xN0GeruIwXa xFK7xfQSSczwy3GyMieKwHgbPyNYUXzUWcEMWtEA4X056v1uae7Gk8Xol6/HTOBF+DAa jUj+N0d1vvB7SECdbmMDM+5yTDo0767AmwiVVVHXfdgpsvCYl2Y56kyn/EU/jDPRl0wv eZFBlu2BCCyGy8DVCJW0y4ZXhXTorOihuHiRDbTRG23D0lH5LJd6PUJ6HZY423WXFTeu KKdu1lECAzhAtqZxscSmmRJSjo8lQKoY/7aqnLznC9MrDr5KblEKdRiRiWXQE4GXOYnN qAww== X-Gm-Message-State: AOJu0Yw+5uyuGFGEPI8rne4tsOswUVTDFEjKO9+fWUM8PlDVpYRp6xpv 9evlu2VM5ScRuXyHh/Q7baBlAFWdGucg7NzEuDYykK1rIUtOWe9lNMZf6OjGYN8JVZCo8CqLwpi YMw== X-Google-Smtp-Source: AGHT+IGL8iDNx9aIxBKSwk28P5yE7j3kttoQC4R0cA0ga3Q7z2p9Umc7nbjGluOqCqjb28no5C7xng== X-Received: by 2002:a05:6000:4595:b0:362:b906:99c4 with SMTP id ffacd0b85a97d-36bbc1706f5mr104078f8f.58.1722525476133; Thu, 01 Aug 2024 08:17:56 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36857fdesm20065995f8f.75.2024.08.01.08.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:17:55 -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 07/30] ada: Operator visibility bug in static expression functions Date: Thu, 1 Aug 2024 17:17:15 +0200 Message-ID: <20240801151738.400796-7-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240801151738.400796-1-poulhies@adacore.com> References: <20240801151738.400796-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.5 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~patchwork=sourceware.org@gcc.gnu.org |
Series |
[COMMITTED,01/30] ada: Remove obsolete workaround
|
|
Commit Message
Marc Poulhiès
Aug. 1, 2024, 3:17 p.m. UTC
From: Steve Baird <baird@adacore.com>
In some cases, an expanded name refering to a predefined operator (such as
Some_Package."+") occurring in a static expression function would be
incorrectly rejected with a message saying that the operator is not directly
visible (which, while True, does not make the reference illegal).
gcc/ada/
* sem_ch4.adb (Is_Effectively_Visible_Opertor): Return True if
Checking_Potentially_Static_Expression is True. The accompanying
comment says True is returned "if there is a reason it is ok for
Is_Visible_Operator to return False"; if
Checking_Potentially_Static_Expression is true, that is such a
reason.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch4.adb | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 2281ef9ce71..fc3a2a43c3c 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -278,6 +278,7 @@ package body Sem_Ch4 is (N /= Original_Node (N) and then Is_Effectively_Visible_Operator (N => Original_Node (N), Typ => Typ)) + or else Checking_Potentially_Static_Expression or else not Comes_From_Source (N)); -- Return True iff either Is_Visible_Operator returns True or if -- there is a reason it is ok for Is_Visible_Operator to return False.