From patchwork Thu Aug 1 15:17:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1967893 Return-Path: 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=i4SJo5ql; 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 4WZYNp387Pz1ybV for ; Fri, 2 Aug 2024 01:51:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A85943864818 for ; Thu, 1 Aug 2024 15:51:36 +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 C4599385DDFC for ; Thu, 1 Aug 2024 15:18:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4599385DDFC 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 C4599385DDFC 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=1722525514; cv=none; b=UBJvdfgR760EH2oSzNcahU72qliXV0CQ/Wpe6SZhawrqQkn9V9qmG3nC1pfM+O+b5Nq4uNkFjfwnhErC4NXxmIgItGNO948GDv8LNurDsjmvrOmAPN9nrb6jQn3uh56SQgsjZ8Q8XEb4wXLqggnKeCypL8OtXnT8qYTM8vlrpjQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722525514; c=relaxed/simple; bh=SYBjYlVsiaHFFWYQwwCtZ+a9tc7qFnZbVc3VJz4f3Gc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TQwSkJrD/caRYCdBeVUvMXkko3rKaMpD3+0GQzB1x0rq8aS4YEE3XgGlm9StKIWvIN1AUn1zw0AoI+nPTuIDIs3LUbhwvXLoL8dw6Q66P3Mer5b6H2aJmha376VztEwnztw5O4kifbb5lrOoTIkoRP1SzD6TlEQHmGMLrxRz7Ko= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-368f92df172so3487210f8f.2 for ; Thu, 01 Aug 2024 08:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722525499; x=1723130299; 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=FnW8t1mVb5YV/Eahz318LodGyJ5PgXj01WYNlUSbNAw=; b=i4SJo5qlwN7ZT5Go9Qp0ITDeJilGY/7rtkvNMvJqMS8hgOzI7o/WQXEs9oxcCk8K9O uFf8Frag2KNzeiXxLose88gfe3PwwtbbNJY4Y0b6EwNCI8Xj0+yqM8o00N/OGgZh7huQ 37IyLGiOhw6r/3ttDHsQvBjYWlrV+XdhS949QeeyCeHe8Lx9LCiXDhi1j3O5oLiYiUyJ hVp+ORJC9cvLRSFOYoowulp9loJ3k4fhDsU+H64lT5cv3r/+1641wX6HXh4PfW7ubKeu CGgl25Hzi37YqRMgls1szj+R7PHVRh6dYiviWy0qJYqn6UuvE3wXuQRZgSZX5XhmXhiO 9IqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722525499; x=1723130299; 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=FnW8t1mVb5YV/Eahz318LodGyJ5PgXj01WYNlUSbNAw=; b=eGwBz2q8PUnvBnKzehgYCCnhTUSmakRV11UJT9AKZEHaNtA8jomSWd+yBlerTbbezS k7Px+WdPumFClveIYpSNYeVGkgYc2Y+0dx7oDW5uB+oTRbSzKlAgNDEs2yfNj7H41Rx6 X1ZQWSjfksX5FgcRQa46TD4sEG6vcuoKmJ6b9+SaR/BmTRhZg1K+scBhajpsgsxwFvmr 1fXkL8bUzNmdf6lU+p4JhCavMvZqk9U+Hy7D8yF0zYiwSKzi7X/hZf+lHrNcMDay9TyT KyTyEZZNABNBVFGtDM/oxPpdFHPLVeL+XV+bFEornbhEosBvVdSd3Ffjbt+XvLsFt+HD bVGg== X-Gm-Message-State: AOJu0YwUFfQP0IuM+dU28tweUxBBdtCAsaIteGoHPGUomYjn9U+Cl+HW 0IuuVQ/fu8KNKMYmt5DNQ9XNXH+BTmSPklyjFTE1CO5ZjZrJgbtylxBliB0FJmQel38trs0L8yX +EQ== X-Google-Smtp-Source: AGHT+IGTKTFVM00gz2Zn9DFaJ79Tb2xfUOHUiUU3o2hbaDei+Sa35VGUzfw92BowvTifYAXk8Xi7Qg== X-Received: by 2002:a5d:5101:0:b0:367:9575:2820 with SMTP id ffacd0b85a97d-36bbc14ada2mr113992f8f.45.1722525499471; Thu, 01 Aug 2024 08:18:19 -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.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:18:19 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED 12/30] ada: Change "missing overriding indicator" message from error to warning Date: Thu, 1 Aug 2024 17:17:20 +0200 Message-ID: <20240801151738.400796-12-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 X-Spam-Status: No, score=-13.6 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Steve Baird There is no RM rule requiring an overriding indicator in the case where this message is generated; such a rule was discussed many years ago in an AI, but that AI was never approved. So generate a warning message instead of an error message. And don't even do that if we are in an instance (warning a user they should change the source of an instance seems unlikely to be helpful, at least in this case). gcc/ada/ * sem_disp.adb (Check_Dispatching_Operation): When calling Error_Msg_NE to generate a "missing overriding indicator" message, generate a warning message instead of an error message (and update comment to describe this new behavior). Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_disp.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index fe822290e45..3c1c49f7064 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1666,13 +1666,14 @@ package body Sem_Disp is then Ovr_Subp := Find_Hidden_Overridden_Primitive (Subp); - -- Verify that the proper overriding indicator has been supplied. + -- Warn if the proper overriding indicator has not been supplied. if Present (Ovr_Subp) and then not Must_Override (Specification (Unit_Declaration_Node (Subp))) + and then not In_Instance then - Error_Msg_NE ("missing overriding indicator for&", Subp, Subp); + Error_Msg_NE ("missing overriding indicator for&??", Subp, Subp); end if; end if;