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.
This would probably be very noisy, but would also be very helpful in getting your own code exception safe. In a second step I'd like to have an attribute to denote values that are a "handle", for example a FILE* or an int in open() and socket(), so that gcc could warn about resource leaks in general. -- Summary: Suggest -Wmemleak warning for C++ Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: felix-gcc at fefe dot de GCC build triplet: x86_64-pc-linux-gnu GCC host triplet: x86_64-pc-linux-gnu GCC target triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33715