https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-03
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
             Blocks|                            |87403

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(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. 

Right, a standard conversion sequence is better than a user-defined conversion.

I think if you want a new warning here you need to be very clear about exactly
what you're asking for.

MSVC warns about converting const char* to bool, but that's nothing to do with
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=87403
[Bug 87403] [Meta-bug] Issues that suggest a new warning

Reply via email to