http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33715
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-18 16:53:37 UTC --- (In reply to comment #0) > I would like to have a warning in C++ that warns about local variables > assigned > via operator new or operator new[], but then are not freed in an exception > handling clause in case of an exception. Simple solution: don't do that. Ever. Then you don't need a compiler warning. If you insist on writing such code the cppcheck tool can issue the sort of warning you want (but it gives lots of false positives too).