This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12433] Finds wrong overload of std::operator<<
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2003 22:30:39 -0000
- Subject: [Bug c++/12433] Finds wrong overload of std::operator<<
- References: <20030927205755.12433.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.