[Bug c++/104365] Overload ambiguity not detected
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 3 11:11:32 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't think this is ambigous as conversion from const char* to bool is better
than doing a copy constructor.
Note only MSVC warns about the conversion:
<source>(18): warning C4800: Implicit conversion from 'const char *' to bool.
Possible information loss
<source>(18): note: consider using explicit cast or comparison to nullptr to
avoid this warning
No other compiler I tested warns though.
More information about the Gcc-bugs
mailing list