This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Crash with 'cout << "";'


/*
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/
  ¯ ´` ¯
*/


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