Message ID | 20240621085819.2485987-17-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=AGQwiWp4; 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 4W5BKz2wmFz20X6 for <incoming@patchwork.ozlabs.org>; Fri, 21 Jun 2024 19:06:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4B593896C31 for <incoming@patchwork.ozlabs.org>; Fri, 21 Jun 2024 09:06:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id B6D013896C3D for <gcc-patches@gcc.gnu.org>; Fri, 21 Jun 2024 08:58:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6D013896C3D 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 B6D013896C3D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718960329; cv=none; b=XzAcCYkqgZ/mOrCdEW54OOU35Jc+rmCdQqBrQ6tMzVvF1ul2yJqnsPRWxd0gdiy7i76PRJBTy4j0orIurIemQKGCdjhsTc0lFt0l6UDIg35C/PIcmxeK1whFNRPqGubVfZdFLHsDWiUWUUIxbffwuEaTIhCGy53pRuIWA4us9Yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718960329; c=relaxed/simple; bh=9oXwfncaO7R/+b14lPMxOwbHF5oKwCtg+aBibYpDg1U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RfGMf9kME6WuFgT4gcAKFpldlaT5G97GJtxhm+RSnOV/rU96HE6RfOQW2JbH0pSIy0oZRnDT4YvOpqVnA1SHHfADMk3O4NsGrW39Yg8YkGmhFGz3p5yxklEzROib6w6ttvkr4112jkZ5rL2GA9lvBHPryHkdU0WpXxGkwaVSW04= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-421cd1e5f93so13279615e9.0 for <gcc-patches@gcc.gnu.org>; Fri, 21 Jun 2024 01:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718960323; x=1719565123; 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=G5iZ81c100gFYwKW8ScbpeWRklkh6H+HPjOWMT94iM8=; b=AGQwiWp4g5mckbJw/cXnjjJ/fNoJ+hd4bzG9pofOQXQqyOa+Ii2VsezRWKsf4lmtfx yZDbJx8CYi4etCymR9waDhVAEvwp131OioHqtJiPpT7XPFW1oPdWijxwAEmryTWWFDaM sFijUzxHVmXHvAnw/zCz6ojqNrKLQTZ09ZJoaCm8ApL+8ERGz9O5ObVGOsgGDmscwxqZ XJe691x8kGe8fSEOAlJLGbfIVzZt+LlgqBt0jsb0dlfPZq9IniDqcgmggi7wALoXIU7O FsBDf+6D0R7/0VHJHyqCCZ2jLhV3SxgB6kbCev8jao2yNFBVJvLPNTesHnvCZCuE93b6 KJSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718960323; x=1719565123; 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=G5iZ81c100gFYwKW8ScbpeWRklkh6H+HPjOWMT94iM8=; b=MQ54HLjQRu2EJrzG0lFIZmVfltjeVBH6sk0eEbiLTV3vc/YzrsjtmQXZzkSQ23pnGh us2MhtqE41p4j0olEHOIYfJUKe53oXKmeCQt3LWZkgM2wFrza/NY92a2d7UIoVLSvTa4 WJW+NzmKw77dlnBSVJwa2VmTyVw81bGjnD1OJ6YpKZCINX6FLfQQNFHFxMAVSNdU9EwI mNPhMk+ybTcdKER01Aorvk/HD9NOEAARlC/k8mHy8aZ4MpNk6ZU4nFQO0nLBk+i0OFtC U+malxvbxpLQK8jQbdxgkO07C1Kn3vuUNuOBCV6X/F4oAbQwcWiQNAC07TXUH/43mv1N Uw3A== X-Gm-Message-State: AOJu0YwIENw6KOO6vBfi7esK/NLfM9DFuXSH+BSoLfFJznnQBKgcaOpg CEsuq+MmvuTx1DfLNIUSbd5E3ovvR6LlHuINygE/sFWlZzoRONwjWabmepRTKpoR0VUMr67s9YE = X-Google-Smtp-Source: AGHT+IEZLghuXlzNlU6nGj0dkamBftID9Ab+q+L9cz6wK9jLiX+b2p5QHlPN3gJfuDCRI41IItqEug== X-Received: by 2002:a05:600c:1615:b0:420:2cbe:7efd with SMTP id 5b1f17b1804b1-42475298bd5mr63021345e9.31.1718960323496; Fri, 21 Jun 2024 01:58:43 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:a589:2704:bfe1:5d92]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0c5485sm55322375e9.21.2024.06.21.01.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 01:58:43 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Javier Miranda <miranda@adacore.com> Subject: [COMMITTED 17/22] ada: Reject ambiguous function calls in interpolated string expressions Date: Fri, 21 Jun 2024 10:58:13 +0200 Message-ID: <20240621085819.2485987-17-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621085819.2485987-1-poulhies@adacore.com> References: <20240621085819.2485987-1-poulhies@adacore.com> 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 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/22] ada: Spurious style error with mutiple square brackets
|
expand
|
diff --git a/gcc/ada/sem_ch2.adb b/gcc/ada/sem_ch2.adb index aae9990eb4d..08cc75c9104 100644 --- a/gcc/ada/sem_ch2.adb +++ b/gcc/ada/sem_ch2.adb @@ -25,7 +25,9 @@ with Atree; use Atree; with Einfo; use Einfo; +with Einfo.Entities; use Einfo.Entities; with Einfo.Utils; use Einfo.Utils; +with Errout; use Errout; with Ghost; use Ghost; with Mutably_Tagged; use Mutably_Tagged; with Namet; use Namet; @@ -141,6 +143,14 @@ package body Sem_Ch2 is Str_Elem := First (Expressions (N)); while Present (Str_Elem) loop Analyze (Str_Elem); + + if Nkind (Str_Elem) = N_Identifier + and then Ekind (Entity (Str_Elem)) = E_Function + and then Is_Overloaded (Str_Elem) + then + Error_Msg_NE ("ambiguous call to&", Str_Elem, Entity (Str_Elem)); + end if; + Next (Str_Elem); end loop; end Analyze_Interpolated_String_Literal;
From: Javier Miranda <miranda@adacore.com> When the interpolated expression is a call to an ambiguous call the frontend does not reject it; erroneously accepts the call and generates code that calls to one of them. gcc/ada/ * sem_ch2.adb (Analyze_Interpolated_String_Literal): Reject ambiguous function calls. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch2.adb | 10 ++++++++++ 1 file changed, 10 insertions(+)