From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 02BF53858C39; Thu, 3 Feb 2022 12:19:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02BF53858C39 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104365] Overload ambiguity not detected Date: Thu, 03 Feb 2022 12:19:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status everconfirmed blocked Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2022 12:19:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104365 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-02-03 Status|UNCONFIRMED |WAITING Ever confirmed|0 |1 Blocks| |87403 --- Comment #3 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #1) > I don't think this is ambigous as conversion from const char* to bool is > better than doing a copy constructor.=20 Right, a standard conversion sequence is better than a user-defined convers= ion. I think if you want a new warning here you need to be very clear about exac= tly what you're asking for. MSVC warns about converting const char* to bool, but that's nothing to do w= ith ambiguous overloads, it warns when there is no overloading at all: void f(bool); void g(const char* s) { f(s); } This is warning about narrowing, not confusing overloads. So please explain precisely what you want to warn, when you *don't* want it= to warn, and how users can easily modify their code to avoid the warning if the overload set is written exactly how they intend it to be written, and is correct. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87403 [Bug 87403] [Meta-bug] Issues that suggest a new warning=