From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3610 invoked by alias); 20 Jul 2005 08:59:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3549 invoked by uid 48); 20 Jul 2005 08:59:48 -0000 Date: Wed, 20 Jul 2005 09:53:00 -0000 From: "suckfish at ihug dot co dot nz" To: gcc-bugs@gcc.gnu.org Message-ID: <20050720085943.22566.suckfish@ihug.co.nz> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/22566] New: Incorrect overload resolution on mutable field. X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg02391.txt.bz2 List-Id: 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 >::operator<<(void const*) I expected operator<<(char const*) This is with Fedora's gcc-4.0.1-3.i386.rpm The program: #include #include 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