------- Comment #12 from redi at gcc dot gnu dot org 2010-04-21 09:23 ------- (In reply to comment #8) > By the way, there's no warning with -Wall or even -Wextra. Is there a flag > -Wabsolutely_all_warnings_we_promise that I have missed and that would really > enable *all* warnings ?
No, sorry, there isn't. (In reply to comment #10) > Nah, the pragma must stay, we have it everywhere, consistently. And I really > do > not understand why auto_ptr is *so* special to need more warnings to be > spilled > vs *all* the rest of the library in order to be used safely. Ah, yes, it's > broken, forgot ;) Really, if this is the ultimate analysis of the issue, I > disagree with doing *anything*. :) the reason isn't that it's broken, it's that various members of auto_ptr require the expression "delete _M_ptr" to be well-formed, and warning users when it's not well-formed is very useful. Previously we never added a check because the front-end warned. even if you don't care about auto_ptr (and I still do) THIS AFFECTS SHARED_PTR TOO! We no longer warn on this: struct C; C* f(); std::shared_ptr<C> p( f() ); Chris's patch definitely won't work, since it would affect the rest of <memory> not just auto_ptr. Something like "#pragma pop GCC system_header" would work, and would also make the attribute((deprecated)) on auto_ptr work again! For the std::shared_ptr case I will add a static_assert like we use in unique_ptr. tr1::shared_ptr will have to use an array of sizeof(T) length or something -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43820