------- Comment #6 from oschmidt at gmx dot net 2006-10-12 17:03 ------- > You therefore initialize a variable with itself. This is > a documented way to generate uninitialized variables and > Here's the right combination of flags that warns (for f3() only):
Thank you for your answer, this is very interesting (but where is it documented?). But still *very* dangerous, because the destructor of this unitialized object is called and such the destructor is working with some random memory. So a compiler warning for this makes really sense not only for f3() but also for f4(). BTW: I found that the IBM-C++ Compiler for MVS has similar behaviour, so it really might be a feature and not a bug, althoug a very strange feature. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29117