[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#4011: simple c++ program segfaults



Herbert Xu <herbert@greathan.apana.org.au> writes:

> #include <fstream.h>
> 
> void main( int argc, char **argv) {
>   ofstream ofst;
>   ofst.ofstream( argv[1]);
>   ofst.form( "%s\n", "Hello world");
>   ofst.~ofstream();
> }

Is this actually a bug?  I don't think you are supposed to call a
destructor directly in this situation.  I would assume that the crash
comes when the destructor is called a second time when the program
exits main.

--
Rob



Reply to: