[Bug c++/12433] Finds wrong overload of std::operator<<

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Sun Sep 28 03:59:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12433


igodard at pacbell dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Wrong error message         |Finds wrong overload of
                   |                            |std::operator<<


------- Additional Comments From igodard at pacbell dot net  2003-09-27 22:30 -------
Further info: the problem does not appear to be in the warning message, but in the overload resolution of std::operator<<. In particular, the compiler is finding std::operator<<(ostream&, bool), and coercing the function pointer to bool which results in the (correct) warning given the (incorrect) overload.

std::operator<< is templated to accept any pointer type and put out the text representation of the target address to the ostream. It seems to fail with function pointers though.



More information about the Gcc-bugs mailing list