This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Crash with 'cout << "";'
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Crash with 'cout << "";'
- From: Richard Atterer <atterer at informatik dot tu-muenchen dot de>
- Date: Tue, 19 Oct 1999 10:03:41 +0200 (MET DST)
/*
Hello,
I've been able to isolate another problem with outputting zero-length
things - this time a zero-length character constant. I'm using gcc
2.95.1 19990816 and libstdc++ 2.90.6.1
Cheers,
Richard
*/
#include <iostream>
struct Out { } out;
ostream& operator<<(ostream& s, const Out) {
return s; // executes OK
}
int main() {
cout << out << endl;
cout << ""; // segfault here if string empty
return 0;
}
/*
--
__ _
|_) /| Richard Atterer (currently at Queen's University, Belfast, NI)
| \/¯| http://www.in.tum.de/~atterer/
¯ ´` ¯
*/