From patchwork Thu Jul 4 02:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1956565 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=il19F2TH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WF0Mk2xmZz1xpP for ; Thu, 4 Jul 2024 12:04:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF3B6384A4BE for ; Thu, 4 Jul 2024 02:04:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5A1F2386480B for ; Thu, 4 Jul 2024 02:04:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A1F2386480B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A1F2386480B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720058668; cv=none; b=oTo2IvJD1AFRxKHbay7q50dtxZEDt54q/40R5rt2yUKOAddy0Qi6YRh5pPo44ax/TJbyM5iFHbWqCwfN/m3gHKIrf9ZKxEzVeQgKmQ0ooZlGPNBmosWzCKwe2uZbDeqBmaxxTN56xx260aCDzag/HF/0dbV96Uh7RTArQHbLwKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720058668; c=relaxed/simple; bh=sOHPewwa5SCx5KsNs+kL7H7QQNsnQefb4KMMJ05yTdA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=T9fBXIPvgLbXrVOt+N7ICWp5jUU7RaoDELgD/5qcL5VzYiOoQOYA0/rn0D5ReOpF6APvjax8uOi++3fAMCyQfgHNswgYIglTvzEIqJr7N/aBjWPazJNOimdZoKa4evolHEoqCXRVqHmlkohic2JHHO+zmnB7FOeaKAU8Yo8BsXA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720058667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4gbZCor/mdCj7qOXnUrWnkVQdF6hIv1aQ4BMZzqXLfE=; b=il19F2TH0vSByLrcfb7XoWRmpgLsSVIsLiKRn8bhL9cH/oXvah1jUWwzRhhavkjZ5zpNAU hsEQE8gLY8sr9gIwByv+9zkLPoIsOR+N9ZpJc0Bvhw8VdC6AwHRfQVPY33SOov2cJUU7EO q0Shh7Q12RwqVpwutJMZ+00IoDd5G70= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-K1gLJkfFP4mSpwNwQH-Xtg-1; Wed, 03 Jul 2024 22:04:25 -0400 X-MC-Unique: K1gLJkfFP4mSpwNwQH-Xtg-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4465957b905so1950721cf.0 for ; Wed, 03 Jul 2024 19:04:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720058664; x=1720663464; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4gbZCor/mdCj7qOXnUrWnkVQdF6hIv1aQ4BMZzqXLfE=; b=SyBdmK4nEvw1hVl/rUBau/b8ZnivdgrsjKB8Pni1W5Fy+3XxjpAblZv1gcCThY1Z++ zoU8wGgmWDlLH4dpMaJtrnarrpJGNNc+NUd/fT7uaWgAMQ+Y4q5/iry83ZSnY5yvDwiO LgBPfIuOLjfzeMBRXawFN2e4MH8FUjwRHW5dz4tprlZa3l1wL9geGcCw3uPhyBnU7STK Y0EbIENGKcVElTidZ+SzCcidv6WWOg80Ub2Azl1b1+3Xr7uJdqy13hf/P79gztCdze27 OAucn01pb5WcmFso0bxwzojWP1XrkL/Fo2okqDr9aBUmK+FSKvS14CM1E3WW7jhCyD3Y jouw== X-Gm-Message-State: AOJu0YyjoVHjevNnBE8SER+3k8Q/fnxDbdIR/OS2QyxvVrMtI84WN4Og B+2NBhHw3K2FZYFxiFMLNcMYSlKx5sI/UfoFu9QokF9+n4ZTO8TFdMnTTrg7QSfPt+y8do85gV6 PP4eWmSY2fbLExAUK22IACpUFV4iy1+BeR8mKHItgEmKQfXxutmImXhVL06QLLQXh2rUYffetg+ 82q1d1k1J8d8lTDexfF7lOQkb2vXNJ6hk+Jas= X-Received: by 2002:a05:6214:b6c:b0:6b5:e739:83f4 with SMTP id 6a1803df08f44-6b5ed057a01mr3919606d6.51.1720058664369; Wed, 03 Jul 2024 19:04:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJEnuAKLRVYd2nzZHItOGMz0OpqYDp8Gc0agqC8sIacWPxwWnq6jN8WWkGoFvKfbLkpUeISQ== X-Received: by 2002:a05:6214:b6c:b0:6b5:e739:83f4 with SMTP id 6a1803df08f44-6b5ed057a01mr3919386d6.51.1720058663992; Wed, 03 Jul 2024 19:04:23 -0700 (PDT) Received: from jason-thinkpadp1gen4i.rmtusma.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b59e60c95esm58908576d6.109.2024.07.03.19.04.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 19:04:23 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: OVERLOAD in diagnostics Date: Wed, 3 Jul 2024 22:04:17 -0400 Message-ID: <20240704020422.764925-1-jason@redhat.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In modules we can get an OVERLOAD around a non-function, so let's tail recurse instead of falling through. As a result we start printing the template header in this testcase. gcc/cp/ChangeLog: * error.cc (dump_decl) [OVERLOAD]: Recurse on single case. gcc/testsuite/ChangeLog: * g++.dg/warn/pr61945.C: Adjust diagnostic. --- gcc/cp/error.cc | 6 ++---- gcc/testsuite/g++.dg/warn/pr61945.C | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) base-commit: 03a810da10d8dfb5aec9261372cad7bf090e6986 prerequisite-patch-id: bc2e5a849f285a95d7446f7675a79a4a6733df14 diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc index 171a352c85f..1f36563ae2c 100644 --- a/gcc/cp/error.cc +++ b/gcc/cp/error.cc @@ -1407,10 +1407,8 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags) break; } - /* If there's only one function, just treat it like an ordinary - FUNCTION_DECL. */ - t = OVL_FIRST (t); - /* Fall through. */ + /* If there's only one function, dump that. */ + return dump_decl (pp, OVL_FIRST (t), flags); case FUNCTION_DECL: if (! DECL_LANG_SPECIFIC (t)) diff --git a/gcc/testsuite/g++.dg/warn/pr61945.C b/gcc/testsuite/g++.dg/warn/pr61945.C index 3d40581e5e3..2252330835f 100644 --- a/gcc/testsuite/g++.dg/warn/pr61945.C +++ b/gcc/testsuite/g++.dg/warn/pr61945.C @@ -7,5 +7,5 @@ class A { }; class B : A { template - void foo (); // { dg-message "by .B::foo\\(\\)." } + void foo (); // { dg-message "by .*B::foo\\(\\)." } };