This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24291] New: problem with std::stringstream
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2005 20:51:30 -0000
- Subject: [Bug c++/24291] New: problem with std::stringstream
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This code:
#include <sstream>
#include <iostream>
int main() {
std::cerr << static_cast<std::stringstream&>(std::stringstream() << "foo"
<< "bar").str() << "\n";
return 0;
}
prints:
~/ootbc/members/src$ a.out
0x8048c58bar
The "foo" operand is being formatted as a pointer rather than a C string.
Strangely, the second "bar" operand is formatted correctly.
Ivan
--
Summary: problem with std::stringstream
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24291