public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7824: Temporary ostream doesn't work properly with operator<< and const char*
@ 2002-09-04 0:26 phil
0 siblings, 0 replies; only message in thread
From: phil @ 2002-09-04 0:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 7824
>Category: c++
>Synopsis: Temporary ostream doesn't work properly with operator<< and const char*
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 04 00:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Philip Dunstan
>Release: gcc 3.2
>Organization:
>Environment:
luke 35> uname -a
Linux luke.nixltd.com.au 2.5.8 #6 SMP Mon Aug 26 12:42:21 WST 2002 i686 unknown
luke 36> gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 (Red Hat Linux Rawhide 3.2-1)
>Description:
std::ostream(std::cout.rdbuf()) << "Hello world";
prints the address of the string. This happens only
when the lhs is a temporary.
>How-To-Repeat:
compile ostream.cpp and run
It should print an address followed by Hello world.
Instead it prints the address twice.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="ostream.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ostream.cpp"
Ly8gdmk6ZXQ6dHM9Mjpzdz0yOnN0cz0yCiNpbmNsdWRlIDxpb3N0cmVhbT4KaW50IG1haW4gKCkK
ewogIGNvbnN0IGNoYXIqIHN0ciA9ICJIZWxsbyB3b3JsZCI7CiAgc3RkOjpjb3V0IDw8IHN0YXRp
Y19jYXN0PGNvbnN0IHZvaWQgKj4oc3RyKSA8PCBzdGQ6OmVuZGw7CiAgc3RkOjpvc3RyZWFtKHN0
ZDo6Y2Vyci5yZGJ1ZigpKSA8PCBzdHIgPDwgc3RkOjplbmRsOwogIHJldHVybiAwOwp9CgoK
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-09-04 7:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-04 0:26 c++/7824: Temporary ostream doesn't work properly with operator<< and const char* phil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).