This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22566] New: Incorrect overload resolution on mutable field.
- From: "suckfish at ihug dot co dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jul 2005 08:59:48 -0000
- Subject: [Bug c++/22566] New: Incorrect overload resolution on mutable field.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program prints a hex address. I expected it to print "Hello, world"
nm | c++filt|grep operator shows that the operator<< used is:
std::basic_ostream<char, std::char_traits<char> >::operator<<(void const*)
I expected operator<<(char const*)
This is with Fedora's gcc-4.0.1-3.i386.rpm
The program:
#include <sstream>
#include <stdio.h>
struct cerror {
~cerror() { printf ("%s\n", s.str().c_str()); }
mutable std::ostringstream s;
};
int main()
{
cerror().s << "Hello, world\n";
return 0;
}
--
Summary: Incorrect overload resolution on mutable field.
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: suckfish at ihug dot co dot nz
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22566