This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for "self-reset"
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Aug 2013 17:38:35 +0000
- Subject: [Bug libstdc++/58159] unique_ptr::reset should have debug assertion for "self-reset"
- Auto-submitted: auto-generated
- References: <bug-58159-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
What if the deleter doesn't actually destroy the object, and doing self-reset
is used as a crazy way to trigger the deleter to do something with the pointer,
but not to alter the value of the pointer?
If that's valid then we should only do this for default_delete specializations.