This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33715] Suggest -Wmemleak warning for C++
- From: "fang at csl dot cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2007 20:20:14 -0000
- Subject: [Bug c++/33715] Suggest -Wmemleak warning for C++
- References: <bug-33715-3511@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from fang at csl dot cornell dot edu 2007-10-10 20:20 -------
However, it shouldn't warn for RAII-managed uses of new, e.g.
std::auto_ptr<int> ip(new int);
The operator delete() is done by the destructor upon end-of-life, thereby being
exception safe.
This might allude to a more general problem of annotating pointer-like classes
(e.g. shared_ptr)
for static analyses. (attributes?)
--
fang at csl dot cornell dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fang at csl dot cornell dot
| |edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33715