This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49329] Static method with std::string parameter gets messed up with non-static method with bool parameter
- From: "swante2 at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 11:36:47 +0000
- Subject: [Bug c++/49329] Static method with std::string parameter gets messed up with non-static method with bool parameter
- Auto-submitted: auto-generated
- References: <bug-49329-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49329
Swante <swante2 at web dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #3 from Swante <swante2 at web dot de> 2011-06-09 11:36:45 UTC ---
>(In reply to comment #2)
> you might want to rethink that
>
> cc::xx is a qualified name lookup, so can find both overloads of cc::xx
>
> The implicit pointer-to-bool conversion is a better conversion sequence than
> the user-defined conversion char*-to-std::string so it is selected, but calling
> a member function without an an object is obviously ill-formed
Thanks for the quick replies.
I wasn't aware that the pointer-to-bool conversion is considered by gcc to be
better than a char*-to-std::string conversion.
I also thought, that the first thing the compiler would do, is to
rule out any non-static methods when a static method is inquired;
but apparently I was wrong.
I'll mark the issue as resolved then.