libstdc++/17: cout is not a real ostream; dynamic_cast SEGV's as a result

Paul Barton-Davis pbd@Op.Net
Fri Dec 3 21:37:00 GMT 1999


The following reply was made to PR libstdc++/17; it has been noted by GNATS.

From: Paul Barton-Davis <pbd@Op.Net>
To: Benjamin Kosnik <bkoz@cygnus.com>
Cc: libstdc++-gnats@sourceware.cygnus.com
Subject: Re: libstdc++/17: cout is not a real ostream; dynamic_cast SEGV's as a result 
Date: Sat, 04 Dec 1999 00:28:46 -0500

 >> because cout is not a real ostream, but a _fake_ostream,
 >> dynamic_cast<ClassDerivedFromOstream *> will fail
 >> when applied to a pointer or reference to cout.
 >
 >see http://sourceware.cygnus.com/libstdc++
 >
 >that's what this database is for. . . . if you checkout the CVS sources, 
 >you'll see that cout is indeed a "real" ostream
 
 then why does a dynamic_cast<ClassDerivedFromOstream *> segfault when
 passed a pointer to cout, but not to any other ostream ?
 
 perhaps i am getting my streams implementation from some other library
 like libg++ ?
 
 --p


More information about the Libstdc++-prs mailing list