This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7824: Temporary ostream doesn't work properly with operator<< and const char*


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]