From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1Z4mMZq9GWrZQCcAWB0awg (envelope-from ) for ; Fri, 29 May 2026 12:23:54 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzO7OB5j; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B43FA1E0A3; Fri, 29 May 2026 12:23:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4D3311E062 for ; Fri, 29 May 2026 12:23:54 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D0594BA5435 for ; Fri, 29 May 2026 16:23:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D0594BA5435 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzO7OB5j Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id C3DE54BA5435 for ; Fri, 29 May 2026 16:23:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3DE54BA5435 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 C3DE54BA5435 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780071807; cv=none; b=IXFxe+a5O0zQqn764Fd0bRo3KCU5laPCPPOVqzAvnBY2srPUbDEwlKx8Uc/oj6we6K7DSvfVRzCeBI9UMte+rfj0e4s4LM3aQaI+hue4c8N3VMv+3dDSky13XZ7ysYucPLtYywDfpuWtbpnlxwNnJi133VWLE/d9GK1h1l+cwfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780071807; c=relaxed/simple; bh=PYthun5zAcJuhgok2LujCsd2Sn8jYhmcW7flaxjAWBM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=WLzJYfqMG5QrTE4Q1uLhLVcmHFffAUW2P5uhn7z7HFqDnJ0Ln386UNDMewRpfdkKoHSXEccXH/dao3w6xWMEvAvhoUT4L7J0NTMdI7J+JqYp0CTUe4KwGwhDz6pls6OzpGeUWrWTAGF8IpqKmR79WGSq0aWLbTCENjcM+UDNfNA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzO7OB5j DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3DE54BA5435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780071807; 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: in-reply-to:in-reply-to:references:references; bh=5tymB6AVXXTuA/jSsYSy1HSqy5XUOjzcyL2409ixZP8=; b=OzO7OB5jl2NZnQVSiCOnSmThavfmnnacL6VHFBeKpX2qwGAX/jBL4fXJ1C0wLte8yQ/z7T I46vvtBspOhdLtjA0z/Jj6oNFHCvQscss74kZRppZ7EqkLhhll3KSWZ6Ys7JcWm64cXEtY sFsKaxvlsh8Usep/dKfCI9EsMnLkTfM= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-26-3g3XFY3LMraa3VIuV2O0TQ-1; Fri, 29 May 2026 12:23:25 -0400 X-MC-Unique: 3g3XFY3LMraa3VIuV2O0TQ-1 X-Mimecast-MFC-AGG-ID: 3g3XFY3LMraa3VIuV2O0TQ_1780071805 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2bd5b20aaa6so150059725ad.2 for ; Fri, 29 May 2026 09:23:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780071805; x=1780676605; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5tymB6AVXXTuA/jSsYSy1HSqy5XUOjzcyL2409ixZP8=; b=r58knBN51nSFAzorwXvXnLPmashsDjjlQnyGuB2YETx7k8AKWbuJKxmpNjJFOZdJ3j Ts4bIdnAMZz/I2I2FW/o6oW1Emo/AJmT90UfR3s8aHIZcoqhPBMEne/3/CtggL6nbDU5 Pq8aXjLKJJ/EaDWcIm35sjzvU559zgVJlftiKi3/HjXtAorpATjFqfnijRXs5ZOBm0WK Ihr/7aurOUv8nxZTSyGOCPUJbsYuHOa+TA25JleXGv+39e9PQv2wL4ibZfxQVU84g7gz G57LPgoRHnaf0AythTKySMMO8S7luMs3EyJbBTk+FISVbkKj95rbNQmIAfNpwEW/wGlZ WyVw== X-Forwarded-Encrypted: i=1; AFNElJ/OBYXmxPwRSX1GlBZrvH13ok8Ilxjrwb8UT+Ye3nigfyG9ENqobEBXRR1wLZyiXFvoUJifNvUTJ7mDZQ==@sourceware.org X-Gm-Message-State: AOJu0YwTCi8/Y7kl9VzXZMT4Hp8UU7MjNzC8b9F+QxTUmmVLaBhQy9KX s6si1fDhQ/5Z2DE5Q1X0rC7jW9/Pxu8wWajUJ+c/x+jYbAzyS7p2Cj1Z9tOT/DmGEJrGEDpUi85 Ff+hbEumhV0B2I2ZnnrDPqP2xLq2vp83QXa7RmRywmvFWI6iJ72VTcFTx6d0zO+A= X-Gm-Gg: Acq92OEBnNkzWIsmnqdku1I2ovTSe5WTc47ZYMVcEvdlIiO8CwJUiWPgloVyPA9TDY5 fIOreM+HH60UIQCO824txRFhtHDefxbC2m83AkFwkl4RKMqbEPWmDSJjMHaPamM57izsOBv5kUk KIhL4CSzWxPKsQd4XHOUz4mnt4dPDs9My1MBuXXiNO52HdOIf2aDY3iP0j2A8j1nl8Uasfa8TqX DHCN88kRGI+9DF3I2DbGZ/FdkqJsGTs0JBKG6rr2eTIbN9Qces9J2tSQl/pcmQtM2T7nEEWSUko LYK2QAGWs5OD1ySmDH6Sq5SPwTPs+L/CU8c3WU6BHE9In6EcPO71Qu/KhmfGiVDySkU4WqqNLXo GjhGI9x8XGe9pz6SgbinVoljO/YTlj8DjAh8RZd8= X-Received: by 2002:a17:902:f651:b0:2b2:5314:e96a with SMTP id d9443c01a7336-2bf3688ab6dmr6040145ad.34.1780071804519; Fri, 29 May 2026 09:23:24 -0700 (PDT) X-Received: by 2002:a17:902:f651:b0:2b2:5314:e96a with SMTP id d9443c01a7336-2bf3688ab6dmr6039695ad.34.1780071803940; Fri, 29 May 2026 09:23:23 -0700 (PDT) Received: from [150.1.200.157] ([172.56.105.224]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf23a22ae0sm22670085ad.35.2026.05.29.09.23.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2026 09:23:23 -0700 (PDT) Message-ID: <6d0c9018-606f-40a9-ad14-1476ef6534ee@redhat.com> Date: Fri, 29 May 2026 09:23:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] [gdb/testsuite] Fix ambiguous operator warning To: Tom de Vries , gdb-patches@sourceware.org References: <20260529125149.2027857-1-tdevries@suse.de> <20260529125149.2027857-2-tdevries@suse.de> From: Keith Seitz In-Reply-To: <20260529125149.2027857-2-tdevries@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: s8iD2UCJkuY2Ob6O0Jsd74BxLqjihB5tTghYpbia3Oc_1780071805 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 5/29/26 5:51 AM, Tom de Vries wrote: > With gcc 16, defaulting to c++20, and test-case gdb.cp/cmpd-minsyms.exp I run > into: > ... > cmpd-minsyms.cc: In function 'int main(int, char**)':^M > cmpd-minsyms.cc:39:13: warning: C++20 says that these are ambiguous, even \ > though the second is reversed:^M > 39 | if (a == b)^M > | ^^M > cmpd-minsyms.cc:26:8: note: candidate 1: 'int GDB::operator==(const GDB&) [with T = int]'^M > 26 | int operator == (GDB const& other)^M > | ^~~~~~~~^M > cmpd-minsyms.cc:26:8: note: candidate 2: 'int GDB::operator==(const GDB&) [with T = int]' (reversed)^M > cmpd-minsyms.cc:26:8: note: try making the operator a 'const' member function^M > ... > > Fix this by following the advice: > ... > - int operator == (GDB const& other) > + int operator == (GDB const& other) const > { return 1; } > ... > > Likewise in gdb.cp/many-args.exp. This LGTM. Reviewed-By: Keith Seitz Keith